ticky74 / servicestack.authentication.azure Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
There are now like this:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
https://login.microsoftonline.com/common/oauth2/v2.0/token
but this won't work for some apps that need the explicit tenant instead of "common" as explained in https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-limitations
eg of working url:
https://login.microsoftonline.com/1e5efa48-777b-4cb1-9709-d1b4e6fbdf78/oauth2/v2.0/authorize
It will be a breaking change..
I think this errors depends a bit on which scope the provider is registered, but with an easy fix that doesn't matter any more
[Authenticate: 12-4-2017 14:23:58]: [REQUEST: {provider:ms-graph}] System.ArgumentException: An item with the same key has already been added. Key: ClientId at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException(Object key) at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at ServiceStack.Authentication.Azure.AzureAuthenticationProvider.RequestCode(IServiceBase authService, Authenticate request, IAuthSession session, AuthUserSession userSession, IAuthTokens tokens) at ServiceStack.Authentication.Azure.AzureAuthenticationProvider.Authenticate(IServiceBase authService, IAuthSession session, Authenticate request) at ServiceStack.Auth.AuthenticateService.Authenticate(Authenticate request, String provider, IAuthSession session, IAuthProvider oAuthConfig) in /opt/lib/teamcity-agent/work/d09206570215629/src/ServiceStack/Auth/AuthenticateService.cs:line 284 at ServiceStack.Auth.AuthenticateService.Post(Authenticate request) in /opt/lib/teamcity-agent/work/d09206570215629/src/ServiceStack/Auth/AuthenticateService.cs:line 145 at lambda_method(Closure , Object , Object ) at ServiceStack.Host.ServiceRunner
1.Execute(IRequest request, Object instance, TRequest requestDto) in /opt/lib/teamcity-agent/work/d09206570215629/src/ServiceStack/Host/ServiceRunner.cs:line 107
var request = MsGraph.AuthorizationUrl + "/logout?client_id={0}&post_logout_redirect_uri={1}"
.Fmt(clientId, "http://www.google.com");
Currently it's fixed to redirect to google.com.
Would it be possible to implement this?
http://docs.servicestack.net/releases/v4.5.8#authentication-via-oauth-accesstokens
the https://msgraph.microsoft.com/ should not be added to every scope, the openid, offline_access, profile and email should be used without prefix. The others have a specific prefix.
We could re-use the assigned security-groups and assign them to the user like in the windows authentication provider.
why is the username required for a single tenant configuration?
When I try to login (using a form POST to /auth/ms-graph) this exception is raised:
[Authenticate: 11-4-2017 12:34:30]:\n[REQUEST: {provider:ms-graph,userName:[email protected]}]\nSystem.InvalidCastException: Unable to cast object of type 'Microsoft.AspNetCore.Http.Internal.QueryCollection' to type 'System.Collections.Specialized.NameValueCollection'.\r\n at ServiceStack.Authentication.Azure.AzureAuthenticationProvider.Authenticate(IServiceBase authService, IAuthSession session, Authenticate request)\r\n at ServiceStack.Auth.AuthenticateService.Authenticate(Authenticate request, String provider, IAuthSession session, IAuthProvider oAuthConfig) in /opt/lib/teamcity-agent/work/d09206570215629/src/ServiceStack/Auth/AuthenticateService.cs:line 284\r\n at ServiceStack.Auth.AuthenticateService.Post(Authenticate request) in /opt/lib/teamcity-agent/work/d09206570215629/src/ServiceStack/Auth/AuthenticateService.cs:line 145\r\n at ServiceStack.Host.ServiceRunner'1.Execute(IRequest request, Object instance, TRequest requestDto) in /opt/lib/teamcity-agent/work/d09206570215629/src/ServiceStack/Host/ServiceRunner.cs:line 107
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.