Skip to content
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

Companion-API oauth register/update user #7

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

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

pkg/companion-api/api/oauth.go Outdated Show resolved Hide resolved
pkg/companion-api/api/oauth.go Outdated Show resolved Hide resolved
@@ -7,6 +7,7 @@ import (
// 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