identityserver3

Integration testing ASP.NET WebAPI controllers that use bearer authentication with identityserver3

喜欢而已 提交于 2019-12-24 01:39:25
问题 I'm trying to integration test my web api controllers. The application uses JWTs to authenticate users against the resource server. To spool up the application, I'm using the TestServer found in Microsoft.OWIN.Testing. I can obtain a valid JWT by performing a login as a browser would do. I then proceed to add the JWT to the request as follows: request.AddHeader("Authorization", "Bearer " + accessToken.RawData); That header also arrives in the OWIN pipeline. However, all controllers protected

IdentityServer3 constant redirect on login only on mobile

可紊 提交于 2019-12-24 01:15:26
问题 I have a problem where my identity server works great with no problems logging in users on desktop computers. However when i go to the webpage on a mobile app and log in I get a constant redirect situation. It goes to the identity server the first time, I log in, and then when it redirects back to the app it automatically redirects back to identity server and back and forth. If I stop the redirection (by hitting the stop button on the browser) then go to my site I am already logged in now. I

No accesstoken in populated User (Claimsprincipal)

↘锁芯ラ 提交于 2019-12-24 01:06:31
问题 We're using IdentityServer4 for our IdentityServer and IdentityServer3 for the client (ASP.NET MVC 5). Everything works (the User/Claimsprincipal is set correctly through OWIN) except I cannot get the access token from the User. We're using a implicit client which has access to these scopes: openid, profile, testapi Startup.cs: app.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions { Authority = identityServerUrl, RequiredScopes = new[] { "testapi" }

No accesstoken in populated User (Claimsprincipal)

纵然是瞬间 提交于 2019-12-24 01:02:55
问题 We're using IdentityServer4 for our IdentityServer and IdentityServer3 for the client (ASP.NET MVC 5). Everything works (the User/Claimsprincipal is set correctly through OWIN) except I cannot get the access token from the User. We're using a implicit client which has access to these scopes: openid, profile, testapi Startup.cs: app.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions { Authority = identityServerUrl, RequiredScopes = new[] { "testapi" }

Using ASP.NET Role Authorisation with IdentityServer3 implicit flow

不羁的心 提交于 2019-12-24 00:59:22
问题 My single page application uses OidcTokenManager to connect to an IdentityServer3 STS using implicit flow. The client presents the IDS3 access token to a ASP.NET Core (WebApi) web service as a Bearer Token; the web service application is configured to use IDS3 middleware and restricts access to its methods using an Authorize attribute. SPA client configuration: function configureTokenManager() { console.log("configureTokenManager()"); var config = { authority: $config.authority, client_id:

A task was canceled

偶尔善良 提交于 2019-12-24 00:35:54
问题 I am trying to co-host identityserver3 and web api (for user management using Bearer tokens) in the same startup. However I get the following error: A task was canceled. It appears the task cancellation occurs on startup when trying to call http://identity_local/core/.well-known/openid-configuration (identity_local points to localhost). My startup is as follows: app.Map("/core", idsrvApp => { var factory = new IdentityServerServiceFactory(); factory.UserService = new IdentityServer3.Core

IdentityServer3 with ServiceStack and MVC Client

大城市里の小女人 提交于 2019-12-23 22:22:07
问题 I'm new to IdentityServer3 and am just starting to get it set up. It seems to be going quite well and I've been working on the Hybrid flow for an MVC app similar to that shown in Kevin Dockx's Pluralsight course (http://www.pluralsight.com/courses/building-securing-restful-api-aspdotnet) when I tried to configure IdentityServer with MVC error is pops up- Microsoft.IdentityModel.Protocols.OpenIdConnectProtocolException: invalid_request ID Server: new Client { Enabled = true, ClientName = "MVC

Identity Server 3 - 401 on Ajax Calls instead of 302

谁说我不能喝 提交于 2019-12-23 09:17:28
问题 I have a web api / mvc hybrid app and I have configured it to use cookie authentication. This works fine for the mvc portion of the application. The web api does enforce the authorization, but instead of returning a 401 - Unauthorised it returns a 302 - Found and redirects to the login page. I would rather it returns a 401 . I have attempted to hook into the CookieAuthenticationProvider.OnApplyRedirect delegate, but this doesn't seem to be called. What have I missed? My current setup is below

IdentityServer3 User Registration

送分小仙女□ 提交于 2019-12-22 16:12:34
问题 I'm writing an Html/Angular app and am authenticating with IdentityServer3 using the implicit flow. I have that setup and working, but what I'm concerned about is allowing users to register. I know I can inject a register link into the login flow, but that's not what I'm interested in. I would like users to register, then send them a confirmation email, etc. Here is my current setup: 1) xyz.com (angular frontend) 2) api.xyz.com (webapi backend) 3) accounts.xyz.com (identityserver) I know I

[C#, .NET]: Validating users via LDAP through IdentityServer3

ⅰ亾dé卋堺 提交于 2019-12-22 14:59:29
问题 I need a way to validate users within my organization (using LDAP and Active Directory) through IdentityServer3 and grant them access to a resource. IdentityServer3 appears to be an implementation framework of the OpenID Connect protocol which holds good for authentication and authorization. So far, I have been able to validate hard-coded users and get a JWT (JSON Web Token) access token using the InMemory implementation. Please refer to this example: https://rajdeep.io/2015/05/07/creating-a