esneko / ideaport

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ideaport

ASP.NET Core 2.1 web app that authenticates a user against Azure AD B2C identity service using an OpenID Connect bearer token and validates an access to the web API according to the claims included in the JWT token.

Usage

.NET Core CLI

Restore the application dependencies and run the Kestrel web server:

$ dotnet restore
$ dotnet run

Docker Container

Build a Docker image that includes the application with all of its dependencies and run the image as a container:

$ docker-compose up

Or pull the pre-built image from Docker Hub and run the image with mapping host machine’s port 5000 to the container’s published port 80:

docker pull esneko/ideaport
docker run --rm -p 5000:80 esneko/ideaport:latest

Azure App Service

The image deployed from Docker Hub to Azure Web App for Containers is available.

Web API

Obtain a token by signing in on Azure AD B2C login page:

Email: esneko@gmail.com
Password: qwerty123$

Replace the {token} with one obtained from the link above and try to access the web API via curl:

curl http://ideaport.azurewebsites.net/api/users -i --header "Authorization: Bearer {token}"

About


Languages

Language:C# 96.5%Language:Dockerfile 3.5%