angular / angular/angularfire

Login with Apple

オープン
#3,319 コメント 1 件 リアクション 5 件 担当者 1 名 @davideast が担当を希望しています GitHub で見る
主要言語
TypeScript
スター
7.8k
フォーク
2.2k
平均マージ
22時間 28分
マージ済み PR(30日)
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 を短くまとめたダイジェスト。