文章加密

;

2022年6月9日 星期四

sign in with apple


<divid="appleid-signin"data-mode="center-align"data-color="black"data-border="false"data-border-radius="16"data-size="32"></div>

https://appleid.apple.com/signinwithapple/button

程式串接:

apple open id 要先連到

https://appleid.apple.com/auth/authorize?
response_type=code
&redirect_uri={redirect_uri}
&client_id={client_id}
&scope=openid%20email
&response_mode=form_post


ex: https://appleid.apple.com/auth/authorize?response_type=code&redirect_uri=https%3A%2F%2Fidp.demologin.com%3A9443%2Fcommonauth&client_id=idp.demoglogin.com&scope=openid%20email&response_mode=form_post


完成之後會轉頁到

{redirect_uri}?code=*********

然後後端再用code 去串apple api 拿到用戶資料

登入後會轉頁到 我們定義的 {redirect_uri} 網址,後面會帶上 code參數

後端再拿那個參數 跟 apple 取得會員資料


or...

或是你也可以直接使用apple官方提供的方式

https://developer.apple.com/documentation/sign_in_with_apple/displaying_sign_in_with_apple_buttons_on_the_web


埋入div#appleid-signin 跟script,他就也會 div#appleid-signin 產生 一個圖示 連結到

https://appleid.apple.com/auth/authorize?
response_type=code
&redirect_uri={redirect_uri}
&client_id={client_id}
&scope=openid%20email
&response_mode=form_post