Open6
Flutter/Firebase Auth/sign_in_with_apple
初めてのスクラップ
apple_sign_in でのFlutter & Sign in with Apple の記事は書いたが、古くなってしまったので、
推奨されている sign_in_with_apple パッケージで SIWAを実装する
SignInWithApple.getAppleIDCredential(scopes: [])
で取得した AuthorizationCredentialAppleID
の中身
authorizationCode:"XXXXX.0.xxxx.XXXX-XXXX"
email:null
familyName:null
givenName:null
identityToken:"XXXXX.XXXXX…"
state:null
userIdentifier:"0000.0000xxxxxxx00000.0000"
hashCode:433369632
runtimeType:Type (AuthorizationCredentialAppleID)
OAuthProvider(AuthMethod.apple.id).credential(accessToken:idToken:)
で取得した AuthCredential
accessToken:"AuthorizationCredentialAppleID.authorizationCodeと同一"
idToken:"AuthorizationCredentialAppleID.identityTokenと同一"
providerId:"apple.com"
rawNonce:null
secret:null
signInMethod:"oauth"
token:null
hashCode:16532053
runtimeType:Type (OAuthCredential)
OAuthProvider(AuthMethod.apple.id)
OAuthProvider (AuthProvider(providerId: apple.com))
_parameters:null
_scopes:List (0 items)
providerId:"apple.com"
hashCode:747490155
parameters:null
runtimeType:Type (OAuthProvider)
scopes:List (0 items)
oAuthProvider.credential(
accessToken: credential.authorizationCode,
idToken: credential.identityToken,
)
OAuthCredential (AuthCredential(providerId: apple.com, signInMethod: oauth, token: null))
accessToken:"xxxxx.xx.xxxxxx"
idToken:"xxxxx.xxxxx…"
providerId:"apple.com"
rawNonce:null
secret:null
signInMethod:"oauth"
token:null
hashCode:1064853605
runtimeType:Type (OAuthCredential)
iOSでSign in with Appleを始めたが、ユーザーが「キャンセル」ボタンを押した時は例外がスローされる。
SignInWithAppleAuthorizationException
code: AuthorizationErrorCode (AuthorizationErrorCode.canceled)
message: "The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1001.)"