sign in with Apple in chrome extension with scope=name email

463 views Asked by At

I am building a Chrome extension with OAuth sign in features. In order to keep the same user base of a mobile app I am implementing Facebook, Google and Apple sign in.

Using the chrome.identity API I was able to implement the sign in for Facebook, Google without problems.

I am now trying to implement the same for Apple. To do so I call:

const options = { interactive: true, url: https://appleid.apple.com/auth/authorize?client_id=XXXXXXX&redirect_uri=https%3A%2F%2Fxxxxxxxx.chromiumapp.org&response_mode=form_post&response_type=code%20id_token&scope=name%20email };

chrome.identity.launchWebAuthFlow(options, (returnUrl) => {});

Since I need the user email and name I added the scope "name email" to my parameters but this force me to use the response_mode: 'form_post' (documented here https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms). When response_mode is set to form_post the result data is not appended to the request_uri, as a result the sign in works but I am not able to extract the information I need. Removing the scope and using response_mode=query works (I am able to extract the id_token from the redirect_uri) but I cannot extract the user email and name.

Is there a workaround to this?

0

There are 0 answers