Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make the example more readable #15

Closed
aeneasr opened this issue Jan 11, 2016 · 3 comments
Closed

make the example more readable #15

aeneasr opened this issue Jan 11, 2016 · 3 comments
Labels
help wanted We are looking for help on this one.

Comments

@aeneasr
Copy link
Member

aeneasr commented Jan 11, 2016

The example is not very readable right now and might be confusing to new developers. I gladly accept any PRs that improve the examples :)

@aeneasr aeneasr added the help wanted We are looking for help on this one. label Jan 11, 2016
@metalmatze
Copy link

Hey, talking about examples. Is there an example about how to secure my endpoint?
I can't find anything about extracting the Bearer and passing it on.
Thanks!

@aeneasr
Copy link
Member Author

aeneasr commented Jan 24, 2016

Hey, securing your resource servers is out of OAuth2 scope because there are different requirements in each environment. OAuth2-related publications are dealing with external endpoints (e.g. oauth2 token intropsection) but these are most of the times not compatible with what resource servers require.

As an example: If you use JWT (which is supported in fosite), you could simply validate the tokens cryptographically without any additional call to the authorization server.

What you want to do (most of the times) is extract the bearer token from the authorization header, make a lookup in the database and return all neccessary information to your environment (subject, issuer, scopes, permissions - whatever you need).

I am currently working on a draft for such an endpoint in Hydra. I did not start developing it yet but it might be a good idea to take a look there once in a while: ory/hydra#48

@aeneasr aeneasr closed this as completed Mar 21, 2016
@aeneasr
Copy link
Member Author

aeneasr commented Mar 21, 2016

Is there an example about how to secure my endpoint?

Yes, with ValidateRequestAuthorization(ctx context.Context, req *http.Request, session interface{}, scope ...string) (AccessRequester, error)

juguhan pushed a commit to juguhan/fosite that referenced this issue Feb 22, 2024
fix: issues with the token exchange handlers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We are looking for help on this one.
Projects
None yet
Development

No branches or pull requests

2 participants