Skip to content

Conversation

@blancinot
Copy link

No description provided.

func setup() {
setupOauthOnce.Do(func() {
oauthConfig = &oauth2.Config{
RedirectURL: requireEnv("OAUTH_MYAPP_ENDPOINT", "This app endpoint") + "/oauth/callback",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OAUTH_APP_ENDPOINT sounds better to me

// UserData is a simple user struct with paswordhash and claims
type UserData struct {
PasswordHash string `json:"password"`
OauthToken string `json:"oauth_token"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expected multiple oauth identities bound to a single account here (ie: 1 google, 1 github, etc)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. It means that for each client account (ie: 1 google, 1 github, etc.), 1 companion-api will have to be deployed. Or it is also necessary that the companion-api can manage the "n-account" with several CLIENTID, ... etc?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say we want something like <prefix>/oauth/<provider>/<client-id> pointing to the associated user account.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what I mainly meant was to use this path as an etcd storage key, ie associating user foo with clientid bar in provider baz is kv.Put("oauth/baz/bar", "foo") (and the symmetric Get to check a clientid knowning the source provider to get the user id to query).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the multiprovider support is also required and LGTM ;)

@blancinot
Copy link
Author

second (better) try 😄

blancinot added 2 commits September 17, 2019 18:22
feat(oauth): association userID with clientID (clean)

feat(oauth): association userID with clientID (clean)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants