-
Notifications
You must be signed in to change notification settings - Fork 110
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
Sign in with Solana #584
Sign in with Solana #584
Conversation
Review notes: This pr is quite large, but can be broken down by lib
Sample apps:
|
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.
A lotta plumbing for...something useful?
@@ -145,13 +146,17 @@ public static class AuthorizationResult { | |||
public final Uri walletUriBase; | |||
@NonNull @Size(min = 1) | |||
public final AuthorizedAccount[] accounts; | |||
@Nullable | |||
public final SignInResult signInResult; |
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.
The ergonomics of this object feels...odd, given its overlap with some of the values in the AuthorizedAccount
object. But I don't really think there is a better option than this. I think you were forced to bolt this on.
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 im not thrilled with it. I could subclass the authorize objects but that would add complexity elsewhere so this felt the least bad (lol).
Still needs a bit of tweaking and review, but SIWS is working!
Both
fakedapp
andfakewallet
have been updated in this PR. Fakedapp now has a "Sign in with Solana" button that will initiate an authorize request with a sign in payload. Fakewallet has been updated with a new UI to handle authorize requests that contain a sign in payload. Fakewallet with both authorize the dapp and sign the sign in payload in one step. There is also a "Simulate Sign In Not Supported" button on this UI that will complete the authorize request and ignore the signin payload, to simulate a legacy wallet, or a wallet that does not thesolana:signInWithSolana
feature. In this case, Fakedapp will fall back on a generic sign message request immediately after the authorize request is completed by the wallet. In both casesfakedapp will verify the signed payload and display a success message.completes implementation for #439