Code Monkey home page Code Monkey logo

Comments (6)

brockallen avatar brockallen commented on August 19, 2024

Does this help at all?

http://leastprivilege.com/2014/10/02/401-vs-403/

from identityserver3.samples.

kansberry avatar kansberry commented on August 19, 2024

It may, I will have to review. The main issue I am reporting is that the Sample code does not appear to work out of the box. If I had a working example, I think I could get my app to work. The main item I would like to verify is whether the access token returned from the token endpoint for the authorization code flow is correct and should look something like this:

"f71523f92b464fb5a232007aaf7df9e9"

For both my app and the MVC CodeFlowClient, the access token looks like the one above, which I don't think looks right (i..e not like the access token used in the implicit code flow example show above).

from identityserver3.samples.

brockallen avatar brockallen commented on August 19, 2024

Ok, I'll look at it. Thx.

from identityserver3.samples.

kansberry avatar kansberry commented on August 19, 2024

I believe I have debugged this. There seems to be two issues with the example code. First, the IdentityServer "Host" project has the "Client.cs" file with "codeclient" set to return an "AccessTokenType" of "AccessTokenType.Reference". Because of this, the token endpoint was always returned the another code and not the access token. By setting AccessTokenType within the "codeclient" to "AccessTokenType.Jwt", the first trip to IdentityServer was returning a code, as expected, and the second trip now returns a valid access token when "OAuth2Client.RequestAuthorizationCodeAsync" is called passing the code.

The 403 issue was exactly as stated in the article you referenced in your first post. "Profile" was not a valid scope so 403 was returned.

By changing the "Host" projects Client.cs file and removing "profile" from the scope, the code executes correctly.

from identityserver3.samples.

leastprivilege avatar leastprivilege commented on August 19, 2024

The sample works as expected - the reference token was by design - you can of course change it to Jwt - but this will make your cookie much bigger.

The service requires a scope of either "read" or "write" - so you need to request that on the first page to be able to access it.

from identityserver3.samples.

kansberry avatar kansberry commented on August 19, 2024

Thanks. I finally found my issue. After review of the latest version the "SelfHost (Minimal)" project, I realized I did not have AccessTokenValidationEndpoint enabled in my IIS version of IdentityServer. Enabling this allowed reference tokens to work. Who would have thought that!

Thanks for all your help and guidance.

from identityserver3.samples.

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.