Questions tagged [aspnet-contrib]
75 questions
21
votes
2 answers
AspNetCore.Authentication.JwtBearer fails with No SecurityTokenValidator available for token with .net core RC2
I'm trying to get a simple endpoint working that issues and consumes JWT tokens using AspNew.Security.OpenIdConnect.Server to issue the token and validating using Microsoft.AspNetCore.Authentication.JwtBearer.
I can generate the token fine but…

koocbor
- 333
- 1
- 3
- 12
20
votes
3 answers
How to handle expired access token in asp.net core using refresh token with OpenId Connect
I have configured an ASOS OpenIdConnect Server using and an asp.net core mvc app that uses the "Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.0.0 and "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0". I have tested the "Authorization…

longday
- 4,075
- 4
- 28
- 35
15
votes
2 answers
Why is my JWT bearer authentication recognizing tokens as expired 5 minutes after the token says?
I'm using AspNet.Security.OpenIdConnect.Server to issue JWT tokens and have the AuthorizationCodeLifetime set to 30 seconds for testing. Here is the snippet of code I'm using to set the options
options.TokenEndpointPath = "/api/token";
…

Derek Greer
- 15,454
- 5
- 45
- 52
8
votes
2 answers
How do you troubleshoot AspNet Core missing dependencies?
So I made a change to my project.json which caused a re-restore which is coming up with a bunch of unresolvable dependencies. How do you figure out what is going on here? This was definitely working as I wrote quite a bit of code against this…

jmorc
- 560
- 1
- 3
- 14
7
votes
1 answer
Use OpenIdConnectServer and try to connect to Facebook through API service
I'm trying to figure out a way of making my API being able to associate a user from Facebook to my Identity users.
The application context
I'm developing a mobile application (In Xamarin) that needs to make login with Username/Password and with…

Raphael Furlan
- 103
- 6
7
votes
2 answers
Authorize via JWT Token
ASP.NET Core 5 with ASP.NET Identity 3.0, I'm using both web pages and apis. I am using OpenIddict to issue a JWT token and to authenticate. My code looks as such:
X509Certificate2 c = new X509Certificate2(@"tokensign.p12",…

Adam
- 3,872
- 6
- 36
- 66
7
votes
1 answer
Separating Auth and Resource Servers with AspNet.Security.OpenIdConnect - the Audience?
The example on the AspNet.Security.OpenIdConnect.Server looks to me like both an auth and resource server. I would like to separate those. I have done so.
At the auth server's Startup.Config, I have the following…

Mickael Caruso
- 8,721
- 11
- 40
- 72
6
votes
1 answer
Overriding TokenEndPoint in AspNet.Security.OpenIdConnect.Server
question related to this post here: Configure the authorization server endpoint.
Using the above example I am able to get token. previously it was possible to get additional information by over riding
public override Task…

BHR
- 193
- 1
- 9
6
votes
1 answer
How to specify the destination for an existing ClaimsIdentity?
I'm using below code to create a ClaimIdentity in OpenIdConnectServerProvider.AuthorizationProvider. But the identity.Name is not searlized. How to allow the OpenIdConnectServer serarlize the name? Thanks.
The previous question is here How to create…

Tony Woo
- 198
- 2
- 7
6
votes
1 answer
Validating Tokens Issued by AspNet.Security.OpenIdConnect.Server (ASP.NET vNext)
I am using Visual Studio 2015 Enterprise and ASP.NET vNext Beta8 to build an endpoint that both issues and consumes JWT tokens. I Originally approached this by generating the tokens myself, as described here.
Later a helpful article by @Pinpoint…

42vogons
- 683
- 7
- 19
5
votes
1 answer
OpenIdDict in ASP.NET 4.5 or alternative frameworks?
In an old project we used ASP.NET 4.5 and I would like to use the Framework OpenIdDict in it. It's made vor ASP.NET Core 1 and 2. Can I still use it? What do I have to pay attention to? If I can't use that, which alternatives do you know?
Link to…

dafna
- 893
- 2
- 10
- 21
5
votes
1 answer
ASP.NET Core OpenIdConnectServer data protection keys location
Hello,
In my ASP.NET Core application I'm using an OpenIdConnectServer for Api authentication. Everything works fine.
But there is one thing I cannot resolve - how to set custom folder for persisting token signing keys?
In service configuration I…

rudolfdobias
- 1,778
- 3
- 17
- 40
5
votes
1 answer
OpenIddict Get User Id in the token Response
Using ASP.NET Core with OpenIddict password grant.
When calling an authentication end point, I am getting this:
{
"token_type": "Bearer",
"access_token": "eyJhbGciOiJ...",
"expires_in": 1800
}
How can I include the user id in the response? I…

Adam
- 3,872
- 6
- 36
- 66
5
votes
1 answer
Claims Based Authentication with OpenId Connect
I am using ASP.NET Core with OpenIddict, JWT, Resource Owner Grant and claims-based role. Authorization without enforcing any policy is working as expected.
I want to enforce authorisation policies on some controllers and action methods. All my…

Adam
- 3,872
- 6
- 36
- 66
5
votes
1 answer
JWT bearer tokens w/ ASP.NET Identity 3
Based on the great example by Shaun Luttin at https://stackoverflow.com/a/30857524 I was able to use that code to generate and consume bearer tokens. Minor changes were to get the latest packages:
"dependencies": {
…

Mark G
- 2,848
- 1
- 24
- 32