Conversation
rosstimothy
left a comment
There was a problem hiding this comment.
Do we need to add CallLoginHooks for SAML/OIDC connectors too? This seems like something that will be very easy to forget to add if any new login processing is added.
It does, but that's a PR for |
codingllama
left a comment
There was a problem hiding this comment.
Apologies for the delay!
Login hooks have been added to support performing arbitrary operations on user login. This is done to support generating of an Okta assignment on user login for the Okta service feature.
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
d77be1f to
3f4c723
Compare
There was a problem hiding this comment.
How are you going to actually use these login hooks? Presumably, you'll need to reconcile user's Okta assignments based on the access requests. The login hook is right now just a function with context and a user - is this enough information in the hook to determine whether you need to create assignments or not? And how would it create them?
TBH I think it would make sense to pair this change with the actual functionality you're introducing it for. Then we can better decide whether this interface works or needs more tweaks.
Also, do the hooks get called for logins via CLI as well?
They should get called via the CLI. Basically enterprise will do a
And the creator will take a: Then we'll use that checker against the groups and apps, which should give us enough of what we need. |
|
https://github.com/gravitational/teleport.e/pull/1198 Here's the associated |
|
LGTM, assuming Roman is happy with the replies. |
* Add login hooks. Login hooks have been added to support performing arbitrary operations on user login. This is done to support generating of an Okta assignment on user login for the Okta service feature. * Don't use error channel for calling hooks, test login hooks. * Expose ResetLoginHooks for external testing. * Provide user as part of login hook. * Update lib/auth/methods.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Improve the documentation for LoginHook, AuthenticateUser returns types.User. * Use user.GetName() instead of username in AuthenticateSSHUser response. * Address nits and restore comments. --------- Co-authored-by: Alan Parra <alan.parra@goteleport.com>
* Add login hooks. Login hooks have been added to support performing arbitrary operations on user login. This is done to support generating of an Okta assignment on user login for the Okta service feature. * Don't use error channel for calling hooks, test login hooks. * Expose ResetLoginHooks for external testing. * Provide user as part of login hook. * Update lib/auth/methods.go Co-authored-by: Alan Parra <alan.parra@goteleport.com> * Improve the documentation for LoginHook, AuthenticateUser returns types.User. * Use user.GetName() instead of username in AuthenticateSSHUser response. * Address nits and restore comments. --------- Co-authored-by: Alan Parra <alan.parra@goteleport.com>
* Add login hooks. Login hooks have been added to support performing arbitrary operations on user login. This is done to support generating of an Okta assignment on user login for the Okta service feature. * Don't use error channel for calling hooks, test login hooks. * Expose ResetLoginHooks for external testing. * Provide user as part of login hook. * Update lib/auth/methods.go * Improve the documentation for LoginHook, AuthenticateUser returns types.User. * Use user.GetName() instead of username in AuthenticateSSHUser response. * Address nits and restore comments. --------- Co-authored-by: Alan Parra <alan.parra@goteleport.com>
* Add login hooks. Login hooks have been added to support performing arbitrary operations on user login. This is done to support generating of an Okta assignment on user login for the Okta service feature. * Don't use error channel for calling hooks, test login hooks. * Expose ResetLoginHooks for external testing. * Provide user as part of login hook. * Update lib/auth/methods.go * Improve the documentation for LoginHook, AuthenticateUser returns types.User. * Use user.GetName() instead of username in AuthenticateSSHUser response. * Address nits and restore comments. --------- Co-authored-by: Alan Parra <alan.parra@goteleport.com>
Login hooks have been added to support performing arbitrary operations on user login. This is done to support generating of an Okta assignment on user login for the Okta service feature.
Please refer to https://github.com/gravitational/teleport.e/blob/master/rfd/0003e-application-access-okta-integration.md#teleport-to-okta-user-reconciliation for more information.
Note: This diverges slightly from the RFD as it only happens on login as opposed to happening regularly.
There will need to be a follow on PR to handle SAML/OIDC logins.