-
Notifications
You must be signed in to change notification settings - Fork 1
[PB-5453]: feat/token based auth #5
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
Conversation
…oken handling and refresh logic
…ndling; improve error handling and response management
backend/internxt/auth.go
Outdated
| info.RootFolderID = resp.User.RootFolderID | ||
| fs.Debugf(nil, "Using RootFolderID from refresh response: %s", info.RootFolderID) | ||
| } else if resp.User.UUID != "" { | ||
| info.RootFolderID = resp.User.UUID |
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.
Is this right? I think that the user.uuid cannot be used as the rootFolderId 🤔
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.
yeah, that made no sense I must have been trying to get this from somewhere else as a sort of fallback. but I just streamlined this code since we call refresh anyway just like cli does there is no point in attempting to get this info from somewhere else. We now just get it from the refresh response
| return | ||
| } | ||
|
|
||
| mnemonicBytes, err := base64.StdEncoding.DecodeString(mnemonicB64) |
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.
maybe it could be a good idea to check also if the mnemonic is valid, i dont know about golang dependencies but i think it should exist at least one haha
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.
sounds good, added an explicit mnemonic check now
…etrieval from the refresh endpoint
…c validation and improved error redirection
Implement auth flow, following the Box backend.
SSO Authentication Flow:
Automatic Token Refresh (Box Backend Pattern)
Follows Box backend JWT implementation (backend/box/box.go) for: