Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

autoprovision new users on login #55

Closed
butonic opened this issue Jun 19, 2020 · 10 comments · Fixed by #58
Closed

autoprovision new users on login #55

butonic opened this issue Jun 19, 2020 · 10 comments · Fixed by #58
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@butonic
Copy link
Member

butonic commented Jun 19, 2020

when the accounts service does not know an account (either by email, username, or custom claim) ocis-proxy should provision the user on the fly. should happen in a dedicated middleware that can be disabled via the config.

followup tasks

  • only for certain email domains?
  • only when the user is known in ldap?
@butonic butonic added enhancement New feature or request good first issue Good for newcomers labels Jun 19, 2020
@C0rby
Copy link
Contributor

C0rby commented Jun 23, 2020

Who will authenticate the user in that situation?
konnectd, ldab or something else?

@kulmann
Copy link
Member

kulmann commented Jun 23, 2020

I guess the normal request flow would be that this happens after the OIDC and account_uuid middlewares in ocis-proxy, so the user should be authenticated already. Just not provisioned in the accounts service, yet.

@kulmann
Copy link
Member

kulmann commented Jun 23, 2020

In fact, it could happen within the account_uuid middleware

@C0rby
Copy link
Contributor

C0rby commented Jun 23, 2020

From my understanding the plan is this

client -requests-> ocis-konnectd -requests-> ocis-glauth -requests-> ocis-account.
And this is how the authentication would work.

But if the ocis-accounts service doesn't know about a user then the above chain would not work since the authentication would fail in the ocis-accounts service.
Maybe my understanding is wrong.

@C0rby
Copy link
Contributor

C0rby commented Jun 23, 2020

Here the diagram that @butonic drew.
ocis-accounts

@kulmann
Copy link
Member

kulmann commented Jun 23, 2020

Step 1 is authenticated already. You only have a bearer token after a successful authentication. So this prerequisite: oidc auth is a blackbox for the authentication. Happens without any involvement of ocis-accounts.

@kulmann
Copy link
Member

kulmann commented Jun 23, 2020

Or maybe I'm not up to date with how we store users. If glauth needs ocis-accounts in the future to do anything, then you're right. But I thought that glauth will continue to have a config file for the available "LDAP" users and not rely on ocis-accounts for that.

@C0rby
Copy link
Contributor

C0rby commented Jun 23, 2020

Yeah, I think we should clarify that. 😄

@kulmann
Copy link
Member

kulmann commented Jun 23, 2020

Hm... just thinking, this ticket is probably not about glauth, but only about scenarios where we have a real LDAP.

@C0rby
Copy link
Contributor

C0rby commented Jun 24, 2020

Ok the scenario is as follows:

The idp has a source other than ocis-glauth/ocis-accounts and authenticates the user.
When the bearer token (may not be a jwt) reaches the ocis-proxy, it validates the token using the userinfo endpoint at the idp
if the token is valid the proxy tries to get the account from ocis-accounts.
If the service doesn't return an account ocis-proxy should create it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants