Giter Club home page Giter Club logo

Comments (7)

leastprivilege avatar leastprivilege commented on August 10, 2024 2

The old access token validation endpoint is not supported in IS4 anymore.

Either switch to local validation - or if you are using reference tokens - configure a scope name and secret in the validation middleware to use introspection.

See here for our cross version compat tests:
https://github.com/IdentityServer/CrossVersionIntegrationTests

from identityserver4.accesstokenvalidation.

leastprivilege avatar leastprivilege commented on August 10, 2024 2

your last snippet looks good - that's thats needed.

from identityserver4.accesstokenvalidation.

ruskindantra avatar ruskindantra commented on August 10, 2024 1

Thank you @leastprivilege, some parts of that API use JWT tokens and some external parts use reference tokens, having said that won't I need both? And I think I got it working with just this:

services.AddAuthentication("Bearer")
                .AddIdentityServerAuthentication(options =>
                {
                    options.Authority = "http://localhost:5000";
                    options.RequireHttpsMetadata = false;
                    options.ApiName = "api1";
                    options.ApiSecret = "secret";
                })

Note in the above that I haven't used .ClientId as my external clients can be dynamically generated (which all use reference tokens). Is that the correct way of doing it?

from identityserver4.accesstokenvalidation.

alessandroros avatar alessandroros commented on August 10, 2024

Oh my god is working! Thanks a lot for what you're doing with this project. Usefull examples.

from identityserver4.accesstokenvalidation.

ruskindantra avatar ruskindantra commented on August 10, 2024

@leastprivilege I am using a reference token to invoke the API demonstrated in Quickstart1_ClientCredential but I keep getting an InternalServerError. I added this to my API startup.cs:ConfigureServices method hoping it would help but no luck, can you please help?

services.AddAuthentication("Bearer")
                .AddOAuth2Introspection(options =>
                {
                    options.Authority= "http://localhost:5000";
                    options.ClientSecret = "secret";
                    options.ClientId = "refclient";
                    options.IntrospectionEndpoint = "http://localhost:5000";
                })
                .AddIdentityServerAuthentication(options =>
                {
                    options.Authority = "http://localhost:5000";
                    options.RequireHttpsMetadata = false;

                    options.SupportedTokens = SupportedTokens.Both;
                    options.ApiName = "api1";
                });

from identityserver4.accesstokenvalidation.

leastprivilege avatar leastprivilege commented on August 10, 2024

for reference tokens this is all that's needed:

services.AddAuthentication("Bearer")
                .AddOAuth2Introspection(options =>
                {
                    options.Authority= "http://localhost:5000";
                    options.ClientSecret = "secret";
                    options.ClientId = "refclient";
                });
               

from identityserver4.accesstokenvalidation.

nivs1978 avatar nivs1978 commented on August 10, 2024

Oh my god is working! Thanks a lot for what you're doing with this project. Usefull examples.

What did your Configuration method end up looking. I spend most of the day trying to figure this out, so a working sample snippet would be great. The API samples are in .Net core, and not .Net 4.x and I need to implement IS4 in an old Classic .Net 4.6.2 application.

from identityserver4.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.