identityserver3

Secure API with Azure AD/B2C users

北城以北 提交于 2019-12-05 11:01:31
My use case is: Create users via API with custom fields, nominated password using any email address Update/disable those users via API 'Sign in' to Azure AD app with user details via rest API to obtain token Make authorised requests to Web API when token passed in Http header Can all of this be achieved with straight Azure AD/B2C or should I be looking at some other identity provider e.g. IdentityServer/Auth0? Edit 1 I'm getting very confused between AAD apps/users and B2C apps/users, there is very little guidance on what to use in this case. Using https://docs.microsoft.com/en-us/azure/active

How to store claims from IdentityServer 3 in Azure AD B2C or just include it in tokens issued by AAD B2C

隐身守侯 提交于 2019-12-05 07:28:15
问题 I'm wondering if it is possible to propagate an oid claim or basically any other claim issued by Identity Server 3 to the AAD B2C and make it be a part of the token issued by Azure AD B2C? We need to have an original ID on the client side and all we can get from sub and oid claims is an ID of an AAD B2C user account. I would also like to do the same with roles claim. Any help would be much appreciated. [EDITED] Here is how TechnicalProfile of my Identity Server configuration look like in

How to get the claims out of a authenticated SecurityToken

允我心安 提交于 2019-12-05 06:36:49
问题 I'm passing a token as a string into a SOAP service and have validated that the token is valid. I now have a SecurityToken that in debug mode I can see all the claims and specifically the userId claim I'd like to pass into another method. I can't seem to figure out how to get at the claims. For now I decoded the string version of the token (the none validated string version of the token, I at least waited until after a successful validation.) Here is that code block: SecurityToken

How to get user's information on WebAPI controller after authenticated with IdentityServer?

依然范特西╮ 提交于 2019-12-05 03:08:46
问题 I cannot get user's information on WebAPI controller after my client app authenticates with IdentityServer3 successfully. Below are the steps: "Login With Profile and Access Token" successfully from JavaScript Implicit Client app I see user's data on "ID Token Contents" panel I do "Call service" to my WebAPI service, I see many claims in ClaimsPrincipal but cannot get values such as email, roles displayed on client side. Below are code & responses. Could anyone provide me some helps how to

IdentityServer - AD for authentication and the rest in DB

霸气de小男生 提交于 2019-12-05 03:02:46
问题 I have setup a basic IdentityServer that is up and running. I'm using Identity Manager and Identity Admin to keep everything (user, roles, claims, clients, scopes) in a database. Next step is to integrate authentication with AD. My requirements are: User will be authenticated against AD User permissions (claims/roles) will be stored in database (as they are now) Depending on the client application, I have three different scenarios: In some cases, the identity of the current user should be

Enable Oauth2 client credentials flow in Swashbuckle

别说谁变了你拦得住时间么 提交于 2019-12-04 10:44:05
问题 Im using IdentityServer3 to secure a Web API with the client credentials grant. For documentation Im using Swashbuckle but can't figure out how to enable Oauth2 in the SwaggerConfig for the client credentials (application) flow. Any help would be appreciated! 回答1: I was able to get this working. Most of the answer can be found here. There were a few parts I had to change to get the client_credential grant to work. The first part is in the EnableSwagger and EnableSwaggerUi calls: config

Too many OpenID.nonce cookies cause “Bad Request”

我怕爱的太早我们不能终老 提交于 2019-12-04 07:45:57
I have already gone through links here , here and here which are related to issue I am having. I have Silverlight application using IdentiServer3 for authentication and I started having this issue just now when I implemented log out functionality. Note that the issue has nothing to do with Silverlight because login and logout functionality is actually implemented on the server side which is a classic ASP.Net Web form. (.NET 4.5.1) The application never had logout functionality, so user just used to close the browser so we never encountered this issue before. We have now logout.aspx page and

IdentityServer gets into infinite loop of authentication

对着背影说爱祢 提交于 2019-12-04 03:33:15
问题 I have the following client set up in IdentityServer: new Client { ClientName = "My web application", Enabled = true, ClientId = "mywebapp", ClientSecrets = new List<ClientSecret> { new ClientSecret("somesecret") }, Flow = Flows.Hybrid, ClientUri = "https://app.mydomain.com", RedirectUris = new List<string> { "oob://localhost/wpfclient", "http://localhost:2672/", "https://app.mydomain.com" } } And it is hosted online, let's say https://auth.mydomain.com/core . Trying to modify the MVC OWIN

How to get the claims out of a authenticated SecurityToken

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 21:28:47
I'm passing a token as a string into a SOAP service and have validated that the token is valid. I now have a SecurityToken that in debug mode I can see all the claims and specifically the userId claim I'd like to pass into another method. I can't seem to figure out how to get at the claims. For now I decoded the string version of the token (the none validated string version of the token, I at least waited until after a successful validation.) Here is that code block: SecurityToken validatedToken = null; if (VerifyToken(sPassword, ref response, ref validatedToken)) { var claimsObj = JObject

IdentityServer client authentication with public/private keys instead of shared secrets

三世轮回 提交于 2019-12-03 18:51:47
问题 I'm trying to use public/private keys instead of a shared secret for client secrets with IdentityServer4. This approach is documented here. If it was a shared secret, the request would contain the secret in plain text. e.g. curl -X POST \ http://<identityserver>/connect/token \ -F client_id=abc \ -F client_secret=secret \ -F grant_type=client_credentials \ -F scope=api1 api2 My question is: What should be passed in as the secret with the public/private key authentication method? To give some