-
Notifications
You must be signed in to change notification settings - Fork 784
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
Separating resource & authorisation server roles #24
Comments
I'm interested to know why is it useful to make this type of separation? Just Curious :) |
Its useful when you have a large resources with a lot of endpoints that need securing so you can have a standalone authorize server. This would allow us to setup multiple micro services, and still use the same authorization server. Assets : Service A - Photo Service Scenario 1 - Security : Service A / B / C , ask for a token authorized by Resource A. And therefore do not require us to send our password to 3 different services just one. Also if resource A is compromised , we can then reject all tokens from that resource server and use Resource Server B. Scenario 2 - Temporary Access to resources : Service B wants access to Service C to process some videos . We now can just temporarily give Service B access to the users resources on C without the users name and password. |
@lukepolo , could you clarify what you mean by "Auth Resource Server", please? Do you mean a server acting as both the authorisation and resource server roles? I think I understand your scenarios, but better safe than sorry :) A third scenario could be when communicating across business boundaries. Perhaps the business has bought in some fancy new SSO kit that implements OAuth 2 (and maybe OpenId connect), and now they want to be able to log in to their purchase order system with it. In this case, the PO system isn't creating the token, but simply accepting and verifying it. In some cases, it's even feasible that the service receiving the tokens doesn't need or want any more information than what's in the token. Continuing with the PO system example, here are a couple of scenarios where information in the token would be sufficient
|
Sorry, It should have just been Auth Server . Its only role would to distribute access tokens. |
@lukepolo you mean something similar to office365 where you sign in to login.microsoftonline.com and then get redirected to one of the included (separate) services such as Outlook, SharePoint, OneDrive etc |
@taftse yes, as the login.microsoftonline.com is their auth server while the others are the resources. |
As far as I see it, there are a (broadly) a handful of scenarios for different setups of OAuth 2 resource and authorisation servers
Scenarios 1 and 2 are, I would hazard a guess, the most common overall and the most common in small implementations. Scenarios 3 and 4 are probably more common amongst larger installations and public api's; see Google, Facebook etc. I'd be interested to know @taylorotwell and other contributors' visions for which of these scenarios they feel Passport should be targeting now and which are in mind for further down the road. |
For what it's worth, I started trying to get a complete separation implemented using the old lucadegasperi/oauth2-server-laravel. You can see what I got done before I got distracted in this repo. What I wound up getting to work was being able to have completely separate databases, with the only anchor between the two being a user model on the resource server with its The good news is that lucadegasperi/oauth2-server-laravel and laravel/passport share a common upstream dependency in league/oauth2-server, so this approach may work with passport, also. |
I think I have been able to achieve what you were looking to do
I'm planning on doing a full write-up on how I accomplished this when i have a bit of time |
It would be great to have library for resource server just to validate the JWT token. |
I am also wondering is it possible to use laravel passport as pure oauth/SSO server ?
Could I achieve it using laravel passport? My question is overlaping with @AndyBursh post but this is what I am very interested in at the moment. |
@taftse did you end up making that write-up somewhere? I'm looking for exactly what you're talking about and it's becoming quite important. So I'd love to know how you did it exactly. |
Hi, you can do that with introspect endpoint. |
I know this issue has been closed long back. But for anyone running into this requirement, here is how you solve it. Laravel Passport stores the public and private keys here:
You just need to copy the |
Passport has been design to implement Oauth2 specification. 4 entities are involve in the protocol. The user, Client Application, Autorization server and Resource server. 3- When a user authenticate it self trought clien application (with client information on authorization server) a token is issue to the client application to be use on all next request to resource server. |
Example? I tested with tymondesigns/jwt-auth and could get the token to verify correctly |
Hi Laravel Passport contributors,
I'm glad to see Laravel now has an official, integrated oauth 2 implementation. However, I notice that right now there is no way to separate the resource server and authorisation roles (as defined in the oauth 2 spec). That is to say, Passport cannot be setup purely to be a resource server which accepts and validates JWTs against a known authorisation sever's public key/certificate*.
Is this something that is envisioned in any roadmap of the package? (I don't see one documented anywhere, so perhaps those plans are in somebody's head?) I would be interested in contributing to the splitting of those roles, because I see this as a shortcoming of many other like packages.
Regards,
Andy
*Unless I'm very much mistaken. If somebody could point me in the right direction, that would be appreciated
The text was updated successfully, but these errors were encountered: