-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Decompositioning, implement Fosite #62
Conversation
@leetal keep an eye out for this one :) |
@arekkas i sure will! :)
|
Repositories relevant for the refactor:
|
The following chart is a very basic architecture overview. CLIThe CLI idp.hydra.abc.comI decided to move the identity provider part away from Hydra's core. Instead, it will reside in a microservice. Anyone who wishes to use LDAP or an existing user database as an identity source can do that by implementing the required HTTP REST interfaces (not defined yet). Identity provider(s) will be added using the CLI: connector.hydra.abc.comThe connector is responsible for delegating a user to Google, Microsoft and other third party authentication services and returning "user info" to hydra. Hydra will then use that user info to find a match at the identity provider and confirm that the user exists. The matching will be done internally in hydra (currently known as "oauth2 connection") Connectors will be added using the CLI: Resource Provider EndpointThe middleware and client library will be rewritten and offer two interface:
|
The reworkings of connectors and identity providers let us additionally paralelize lookups with high efficiency. Cash. :) |
|
||
} | ||
|
||
func (o *OAuth2Handler) TokenHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
god, this looks so much cleaner already..
Separating idp.hyra.abc.com, singin.hydra.abc.com and connector.hydra.abc.com is maybe not a good idea. The question is, if idp.hydra.abc.com is even required and if singin and connector should be one. It might be good if hydra took over a lot of the complexity and on the same time, it complicates service flows. |
Complicated: The login endpoint could redirect back to hydra which would redirect that request to Google, MS, and so on. The callback would be a hydra endpoint which would validate the authentication request through a "connection" database lookup and a quick check in at the idp and redirect to the consent endpoint which would issue the consent token. |
Alternative: The login endpoint handles all the third party authentication on its own and is simply responsible for returning a consent token. This would require much more sophisticated login / consent endpoints |
One question that has me spinning in circles is how to handle social / remote logins. There are two possibilities I see right now. Terminology:
The remote party is seen as a standalone IdPThe remote idps (e.g. google) are considered a local idp: When the users signs in using a social login, no lookup is made if that user exists at the local idp. This basically means that we can skip the sign up process. Workflow (simplified)
Pro:
Cons:
The remote party acts as an intermediate connectorIn contrary to above, the remote party is an identity provider as well, but hydra acts as a bridge between it and the local idp. Every user requires thus an account at the local idp and the remote idp in order to sign in. Workflow (simplified)
Pro / Con: TBD |
@@ -20,9 +20,11 @@ type Context struct { | |||
} | |||
|
|||
type Client interface { | |||
TokenFromRequest(r http.Request) string | |||
|
|||
ActionAllowed(token string, action *Action) (*Context, error) | |||
|
|||
Authorized(token string, scopes ...string) (*Context, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be no more middleware, just one client. This will clean up the code base a lot. This interface should basically be implemented by any client in any language. Maybe we can use something like Thrift to build a client library for various languages
Connection needs an endpoint which returns
or some other value for non-OAuth2 requests. This allows for sign up trickery |
is actually the smarter choice, if the endpoint is returning a "connection token" including the remote_id |
The consent token should be able to carry a remote subject and id |
I have decided to switch from postgres to RethinkDB and use the |
Could you list all Hydra APIs (implemented or will be implemented when #62 is merged) in Apiary? This would help us decide whether Hydra is fitted to our system. Thank you a lot :) |
Already on it :) |
0.1-beta is ready. Please try things, and break them. :D |
@aeneasr good history and well written too |
This PR is a refactor and a partial re-code of Hydra. It will mark version
0.1-beta
and will includename
toclient_name
#72 client rest endpoint: renamename
toclient_name
client_name
andclient_secret
change in docsTagline: "A micro-service OAuth2, OpenID Connect and policy decision point provider written in Go". Check also this milestone: https://github.com/ory-am/hydra/milestones/0.1-beta