dasiths / neasyauthmiddleware Goto Github PK
View Code? Open in Web Editor NEWAzure App Service Authentication (EasyAuth) middleware for ASP.NET CORE with fully customizable components and support for local debugging
License: MIT License
Azure App Service Authentication (EasyAuth) middleware for ASP.NET CORE with fully customizable components and support for local debugging
License: MIT License
Add a sample project for AspNetCore 3.0+ and update the readme file examples. A guide of what's required is here https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.1&tabs=visual-studio#migrate-startupconfigure
Having commas in the name
field result in the name being truncated. I assume this is due to the Split(',')
call in the middleware.
{ "typ": "name", "val": "User, Mock" }
Results in only "User" being added to the claim as the Identity.
Lets say I wanted to get the value of id_token
or access_token
from the /.auth/me
endpoint
Is there a way to map those fields to the HttpContext.User
? or can that field be mapped with the use of the CustomClaimMapper
?
As we have to support both AspNet 3 and 5 in the future I believe it's better to have separate nuget packages to evolve separately.
I have an ASP.NET Core React Project. It has 1 controller that is the C# backend API to my React frontend. This project is deployed in to an Azure App Service with EasyAuth enabled.
I've been using the NEasyAuthMiddleware package without the Authorize attribute and it has worked great.
NEasyAuthMiddleware has been fantastic for allowing us to mock EasyAuth when dev'ing locally/ running tests, and fetch the /auth/.me in an intuitive way through enabling the use of HttpContext.User.Identity.Name. Great work - thanks for this.
The issue I am experiencing is to do with caching. When the token expires, the browser still attempts to make calls to the backend API from a cached version. All these calls return a 302 redirect. This shows as a CORS error from Microsoft Login Server.
To resolve this, I thought it'd be wise to add in the [Authorize] attribute above my backend API controller class. When I do this, it doesn't seem to integrate with EasyAuth.
Instead, it displays a login popup. Is this behavior as expected?
'ello
While testing with postman, I always get a 401 Unauthorized.
I'm testing this for an Api that I want to call from Unity using Google sign-in.
I pass the Authentication Token I get from the ".auth/login/google" endpoint on my App Service to my API in the X-ZUMO-AUTH header.
Am I misunderstanding something?
Thanx
Hein
##[error]The nuget command failed with exit code(1) and error(NU1202: Package NEasyAuthMiddleware 2.0.0 is not compatible with net50-windows7.0 (.NETFramework,Version=v5.0,Profile=windows7.0). Package NEasyAuthMiddleware 2.0.0 supports: netcoreapp3.0 (.NETCoreApp,Version=v3.0)
Using this library in a .Net Core 3.1 project and user.Identity.IsAuthenticated is always false.
Had a look around and it seems that you must pass an authentication type as well as your claims into the ClaimsIdentity when you create it.
For reference:
https://stackoverflow.com/questions/20254796/why-is-my-claimsidentity-isauthenticated-always-false-for-web-api-authorize-fil
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.