MoeMemosAndroid icon indicating copy to clipboard operation
MoeMemosAndroid copied to clipboard

SSO support?

Open nogweii opened this issue 1 year ago • 0 comments

0.12.0 was released with OAuth2 support. To make it work, I think you'll need to persist the OAuth 2 code and POST it to /api/auth/signin/sso. The JSON body needs 3 fields:

  • The ID of the identity server configuration, not sure how to get that
  • A redirect URI. Could this be a custom app URI, something like me.mudkip.moememos//sso-redirect? Or maybe use the memos.moe domain? That way, the app can register and handle the URI rather than opening the web browser.
  • The OAuth2 code. Many providers support passing it as a query string parameter so extracting it from that may be the path.

Looking into how the JS interacts with the SSO, it calls an API method /api/idp which is not authenticated to get the list of configured SSO providers. Included in the response is the ID which is needed before.

nogweii avatar Apr 09 '23 00:04 nogweii