cryptoadvance / specter-desktop

A desktop GUI for Bitcoin Core optimised to work with hardware wallets
MIT License
793 stars 237 forks source link

Issues with the oauth2 flow to integrate Swan #2294

Open moneymanolis opened 1 year ago

moneymanolis commented 1 year ago
  1. The link in the email with the OTP is sometimes missing the redirectTo parameter. Without it, the link just leads the user to login and the flow breaks.
  2. With the redirectTo parameter, the flow breaks at the oauth/consent endpoint. grafik
grafik

You cannot approve the scope and you are not redirected back to the redirect URI specified in the original OAuth2 URL (back to Specter). However, the user still gets logged in. If he tries again to link the account in Specter the flow works.

moneymanolis commented 1 year ago

"Solution" suggestion: The linking of the account / integration seems to work fine if the user is logged in before he hits the “Link your account” button. Until the above issues are fixed, we could at least add an info box in the UI to inform the user that the integration only works reliably if he manually logs in first. @moritzwietersheim

aphex3k commented 1 year ago

I can not confirm the suggestion.

  1. I am logged in on app.swanbitcoin.com
  2. I am logged in on Specter Desktop at localhost:25441
  3. When I click "Link your Account" it goes to this url and shows the below error
    https://api.swanbitcoin.com/oidc/auth?client_id=specter&redirect_uri=http://localhost:25441/svc/swan/oauth2/callback&response_type=code&response_mode=query&code_challenge=<redacted>&code_challenge_method=S256&state=<redacted>&scope=offline_access%20v1%20write:vendor_wallet%20read:vendor_wallet%20write:automatic_withdrawal%20read:automatic_withdrawal&prompt=consent
Screenshot 2023-09-01 at 12 51 17 PM