Skip to content

Commit

Permalink
docs(): Azure AD b2c doc clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
moberwasserlechner committed Feb 24, 2021
1 parent 7a3a8ab commit 200ba07
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ On iOS the plugin is registered **automatically** by Capacitor.

Skip this, if you use a [OAuth2CustomHandler](#custom-oauth-handler-1)

Open `ios/App/App/Info.plist` in XCode and add the value of `redirectUrl` from your config without `:/` like that
Open `ios/App/App/Info.plist` in XCode (Context menu -> Open as -> Source) and add the value of `redirectUrl` from your config without `:/` like that

```xml
<key>CFBundleURLTypes</key>
Expand Down Expand Up @@ -549,6 +549,8 @@ See this [example repo](https://github.com/loonix/capacitor-oauth2-azure-example

See these 2 configs that should work.

It's important to use the urls you see in the Azure config for the specific platform.

```typescript
azureLogin() {
Plugins.OAuth2Client.authenticate({
Expand All @@ -563,15 +565,15 @@ azureLogin() {
android: {
pkceEnabled: true,
responseType: "code",
redirectUrl: "com.tenant.app://oauth/auth",
redirectUrl: "com.tenant.app://oauth/auth", // Use the value from Azure config. Platform "Android"
accessTokenEndpoint: "https://tenantb2c.b2clogin.com/tfp/tenantb2c.onmicrosoft.com/B2C_1_SignUpAndSignIn/oauth2/v2.0/token",
handleResultOnNewIntent: true,
handleResultOnActivityResult: true
},
ios: {
pkceEnabled: true,
responseType: "code",
redirectUrl: "msauth.com.tenant://oauth",
redirectUrl: "msauth.BUNDLE_ID://oauth", // Use the value from Azure config. Platform "iOS/Mac"
accessTokenEndpoint: "https://tenantb2c.b2clogin.com/tfp/tenantb2c.onmicrosoft.com/B2C_1_SignUpAndSignIn/oauth2/v2.0/token",
}
});
Expand Down Expand Up @@ -613,7 +615,21 @@ See [Android Default Config](#android-default-config)

#### iOS

See [iOS Default Config](#ios-default-config)
Open `Info.plist` in XCode by Right Click on that file -> Open as -> Source Code. Note: XCode does not "like" files opened and changed externally.

```xml
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>msauth.BUNDLE_ID</string>
</array>
</dict>
</array>
```

Do not enter `://` and part of your redirect url after those chars.

### Google

Expand Down

0 comments on commit 200ba07

Please sign in to comment.