angular / angular/angularfire

Login with Apple

未關閉
#3,319 1 則留言 5 個 reaction 已指派 1 人 已被 @davideast 認領 在 GitHub 檢視
主要語言
TypeScript
星號
7.8k
分支
2.2k
平均合併
22 小時 28 分鐘
30 天內合併 PR
6

描述

Hi,

The Apple login is a little different than Google, Twitter and Facebook login.

With Google Login I use this:
`this.angularFireAuth.signInWithPopup(new firebase.auth.GoogleAuthProvider())
`
For Apple login, there is no object in `firebase.auth.` so I had to use the example provided here: https://firebase.google.com/docs/auth/web/apple?authuser=0&hl=en#web-version-9

```ts
import { getAuth, signInWithPopup, OAuthProvider } from "firebase/auth";

const auth = getAuth();
signInWithPopup(auth, provider)
.then((result) => {
// The signed-in user info.
const user = result.user;

// Apple credential
const credential = OAuthProvider.credentialFromResult(result);
const accessToken = credential.accessToken;
const idToken = credential.idToken;

// IdP data available using getAdditionalUserInfo(result)
// ...
})
.catch((error) => {
// Handle Errors here.
const errorCode = error.code;
const errorMessage = error.message;
// The email of the user's account used.
const email = error.customData.email;
// The credential that was used.
const credential = OAuthProvider.credentialFromError(error);

// ...
});

```

Will you add a AngularFire way for login with Apple?
There is not example at this page: https://github.com/angular/angularfire/blob/master/docs/auth/getting-started.md

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。