Skip to content

Commit

Permalink
Update Apple SSO documentation after certain bug fixes and separation…
Browse files Browse the repository at this point in the history
… of Apps in Apple Developer account
  • Loading branch information
muradkhateeb78 committed Jul 31, 2024
2 parents f9cc44b + f16c247 commit a688d8b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,53 @@ Just as we have other OAuth providers that allow users to sign in user their acc
* An app where you want to enable Apple SSO, `IR Studio` in our case.


Go to [Apple Developer Account](https://idmsa.apple.com/IDMSWebAuth/signin?appIdKey=891bd3417a7776362562d2197f89480a8547b108fd934911bcbea0110d07f757&path=%2Faccount%2F&rv=1) and sign in with and apple Developer account which should have been added to the developer account perviously and must have the right permissions. There, you will need to create an App ID a service ID and later on a private Key, these will give you the credentials that you can then use with in your app to be able to let users log in using their Apple IDs.
Go to [Apple Developer Account](https://idmsa.apple.com/IDMSWebAuth/signin?appIdKey=891bd3417a7776362562d2197f89480a8547b108fd934911bcbea0110d07f757&path=%2Faccount%2F&rv=1) and sign in with and apple Developer account which should have been added to the developer account previously and must have the right permissions. There, you will need to create an App ID, a Service ID and later on a Private Key, these will give you the credentials that you can then use in your app to be able to let users log in using their Apple IDs.

# Create an App ID
In the Apple Developer account, do the following.

1. Go to Section named as `Certificates, Ids & Profiles` and click Identifiers.
<<<<<<< HEAD
2. Create a new identifier, which usually can be created by clicking a small '+' icon besides the identifiers headline. If you do not see that, your logged in user might not have the necessary permissions to add the app ID. Please get your users the right permissions before moving ahead.
3. Click "App IDs", App and click "Continue".
=======
2. Create a new identifier, which usually can be created by clicking a small '+' icon besides the identifiers headline. If you do not see that, your logged in user might not have the necessary permissions to add the App ID. Please get your users the right permissions before moving ahead.
3. Click "App IDs" and click "Continue".
>>>>>>> f16c24753d1de49e18e91a76514d640794d9cc65
4. Fill in the form that opens up.
1. Enter the description.
2. Enter the Bundle ID which could be a revers-domain styled string i.e. 'com.domainname.appname'
3. Scroll down to "Capabilities" section and check `Sign In with Apple` and click continue.
4. verify details and click register.
a. Enter the description.
b. Enter the Bundle ID which could be a reverse-domain styled string i.e. 'com.domainname.appname'
c. Scroll down to "Capabilities" section and check `Sign In with Apple` and click continue.
d. Verify details and click register.

# Create a Service ID
In the Apple Developer account, do the following.

1. Go to Section named as `Certificates, Ids & Profiles` and click Identifiers.
1. Go to section named as `Certificates, Ids & Profiles` and click Identifiers.
2. Click the '+' button beside the 'identifiers'.
3. Click "Service IDs" and click "Continue".
<<<<<<< HEAD
1. Enter the description.
2. Enter the Bundle ID which could be a revers-domain styled string i.e. 'com.domainname.appname'
3. Click "Continue" and "Register".
4. Edit the service ID that you just created. Check `Sign In with Apple` and click on the "Configure" button beside the checked option.
4. You will see a screen for "Web Auhentication Configuration". Select the App ID we created previously as the "Primary App ID". You can add the domains and the Return URLs on which the user will be redirected once it is authentication by Apple.
5. Click "Continue", verify the details and click "Save".
=======
4. Click "App IDs" and click "Continue".
a. Enter the description.
b. Enter the Bundle ID which could be a reverse-domain styled string i.e. 'com.domainname.appname'
c. Scroll down to "Capabilities" section and check `Sign In with Apple` and click on the "Configure" button beside the checked option.
d. You will see a screen for "Web Auhentication Configuration". Select the App ID we created previously as the "Primary App ID". You can add the Return URLs on which the user will be redirected once it is authenticated by Apple.
e. Click "Continue", verify the details and click "Register".
>>>>>>> f16c24753d1de49e18e91a76514d640794d9cc65
Please note that the service ID that you just created will serve as your Client ID while sending authentication requests from your app.
Please note that the Service ID that you just created will serve as your Client ID while sending authentication requests from your app.

# Create the Secret Key
We will also need to create a secret key that we can then use to generate the `Client Secret` which again will be used while sending an authentication request to Apple.

1. Go to "Cretificates, Identifiers & Profiles > Keys".
1. Go to "Certificates, Identifiers & Profiles > Keys".
2. Give a Key Name and check the "Sign In With Apple" checkbox.
3. Click Configure and select the App ID we previously created under the "Choose a Primary App ID" key.
4. Click save, verify the details and click Register.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@
We will need to generate a Client Secret for Apple to be able to send authentication requests to Apple.

# Pre Requisites
<<<<<<< HEAD

You must have the following credentials already with you.

- Key ID,
- Team ID,
- Client ID,
- Developer Account's secret Key file
=======
You must have the following credentials already with you.
1. Key ID,
2. Team ID,
3. Client ID,
4. Developer Account's secret Key file
>>>>>>> f16c24753d1de49e18e91a76514d640794d9cc65

# Generate the Client Secret

Expand Down Expand Up @@ -51,6 +59,7 @@ Please note that this Client Secret will expire in 6 months, we cannot increase

# Updating the Client Secret in IR Studio

<<<<<<< HEAD
Every 6 months, when the Client Secret will expire, you will have to get it updated in the running instances of IR Studio as per the following.

- Generate a new Client Secret as mentioned above.
Expand All @@ -61,6 +70,11 @@ Every 6 months, when the Client Secret will expire, you will have to get it upda
```
helm repo update && helm upgrade --reuse-values --set api.extraEnv.APPLE_CALLBACK_URL=https://ir-engine-mt-dev-api.theinfinitereality.io/oauth/apple/callback --set api.extraEnv.APPLE_CLIENT_ID=com.ir-engine.mt-dev.id --set api.extraEnv.APPLE_CLIENT_SECRET="eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik03N0xRNzVUN1oifQ.eyJpc3MiOiJVS1haTVoyM1A0IiwiYXVkIjoiaHR0cHM6Ly9hcHBsZWlkLmFwcGxlLmNvbSIsInN1YiI6ImNvbS5pci1lbmdpbmUubXQtZGV2LmlkIiwiaWF0IjoxNzIyNDAwMDY3LCJleHAiOjE3Mzc5NTIwNjd9.UI6CYITfZCFN6zgY8SRIeGGlzntfB23TcZOr12sdGorBnzt0K37ZVGm7BT5uIhVEbMWFCSklHDWYFW-SCDUhRA" --set media.extraEnv.APPLE_CALLBACK_URL=https://ir-engine-mt-dev-api.theinfinitereality.io/oauth/apple/callback --set media.extraEnv.APPLE_CLIENT_ID=com.ir-engine.mt-dev.id --set media.extraEnv.APPLE_CLIENT_SECRET="eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik03N0xRNzVUN1oifQ.eyJpc3MiOiJVS1haTVoyM1A0IiwiYXVkIjoiaHR0cHM6Ly9hcHBsZWlkLmFwcGxlLmNvbSIsInN1YiI6ImNvbS5pci1lbmdpbmUubXQtZGV2LmlkIiwiaWF0IjoxNzIyNDAwMDY3LCJleHAiOjE3Mzc5NTIwNjd9.UI6CYITfZCFN6zgY8SRIeGGlzntfB23TcZOr12sdGorBnzt0K37ZVGm7BT5uIhVEbMWFCSklHDWYFW-SCDUhRA" <MT and MT builder Release Name> etherealengine/etherealengine
```
=======
1. Generate a new Client Secret as mentioned above.
2. On the Deployed instance, go to '/admin/settings#authentication'.
3. Update the Apple Client Secret and hit save, it should take a couple of minutes to restart the API pods and should be done then.
>>>>>>> f16c24753d1de49e18e91a76514d640794d9cc65

# Future Work/Recommendations

Expand Down

0 comments on commit a688d8b

Please sign in to comment.