Git Product home page Git Product logo

Comments (6)

brockallen avatar brockallen commented on May 28, 2024

It's now UseIdentityServerBearerTokenAuthentication. See this:

https://github.com/thinktecture/Thinktecture.IdentityServer.v3.Samples/blob/master/source/Clients/SampleAspNetWebApi/Startup.cs#L17

from identityserver3.accesstokenvalidation.

mauriciod73 avatar mauriciod73 commented on May 28, 2024

Thanks Brock, so this class now encapsulates the jwt and reference token configurators? How do we now set up the signing certificates? Is there a more complete example of how to use this class? Thanks

from identityserver3.accesstokenvalidation.

brockallen avatar brockallen commented on May 28, 2024

Yes. The mode property configures if token validation is done locally as a jwt or if requests are made back to identity server to validate the token.

from identityserver3.accesstokenvalidation.

leastprivilege avatar leastprivilege commented on May 28, 2024

You set it using the standard TokenValidationParameters now. Why do you want so set it explicitly?

from identityserver3.accesstokenvalidation.

mauriciod73 avatar mauriciod73 commented on May 28, 2024

It's not that I want to set it explicitly, just trying to understand the new structure, how it works and how it's used, along with the parallels with the previous way of doing it.

from identityserver3.accesstokenvalidation.

mynkow avatar mynkow commented on May 28, 2024

I had a working application and after updating to the latest IdSrv and latest AccessTokenValidation I get 401 all the time. There are no errors. All other applications work fine with the latest IdSrv and the version before this commit 04088fb

I did a debug session. Getting metadata works fine. Issuer is there, cert, audiance etc, but when I do a request it just rejects me.

var _configurationManager = new ConfigurationManager("https://idsrv/.well-known/openid-configuration", new HttpClient(new WebRequestHandler()));
var result = _configurationManager.GetConfigurationAsync().Result;

            var tokens = from key in result.JsonWebKeySet.Keys
                         select new X509SecurityToken(new X509Certificate2(Convert.FromBase64String(key.X5c.First())));

This is my configuration:
app.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions
{
Authority = "https://idsrv",
ValidationMode = ValidationMode.Local,
AuthenticationType = "Bearer"
});

And the token:
{
"client_id": "localclient",
"scope": [
"read",
"write"
],
"iss": "https://idsrv/issuer",
"aud": "https://idsrv/issuer/resources",
"exp": 1418334898,
"nbf": 1418331298
}

One more thing. In one of the debugging sessions I got "invalid bearer token received". Just once...
http://www.symbolsource.org/MyGet/Metadata/aspnetwebstacknightly/Project/Microsoft.Owin.Security.OAuth/2.0.0-rtw2-20821-583-dev/Release/.NETFramework,Version%3Dv4.5/Microsoft.Owin.Security.OAuth/Microsoft.Owin.Security.OAuth/OAuthBearerAuthenticationHandler.cs?ImageName=Microsoft.Owin.Security.OAuth

from identityserver3.accesstokenvalidation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.