Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 52 additions & 6 deletions src/content/docs/developer-tools/sdks/native/ios-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,41 @@ override func viewDidLoad() {
}
```

### Use custom auth pages

You can use a custom sign-up and sign-in page by passing the `connectionId` parameter to the `login`, `register` and `createOrg` methods.


```swift
KindeSDKAPI.auth.login(connectionId: CONNECTION_ID)

KindeSDKAPI.auth.register(connectionId: CONNECTION_ID)

KindeSDKAPI.auth.createOrg(connectionId: CONNECTION_ID)
```

See [Custom sign-up and sign-in pages](/authenticate/custom-configurations/custom-authentication-pages/) to learn more.

#### Bypassing the Kinde initial login page

To skip the initial Kinde login page, pass the `loginHint` and `connectionId` parameters to the `login` and `register` methods.

```swift
KindeSDKAPI.auth.login(
connectionId: CONNECTION_ID,
loginHint: "alex@example.com"
)

KindeSDKAPI.auth.register(
connectionId: CONNECTION_ID,
loginHint: "phone:+61466043123:au"
)
```

This takes the user directly to the Kinde verification page, skipping the page where the user enters their identity, as the `loginHint` parameter [prepopulates the user identity](/authenticate/custom-configurations/prepopulate-identity-sign-in/).

See [Step 3: Add the Connection ID to your design code](/authenticate/custom-configurations/custom-authentication-pages/#step-3-add-the-connection-id-to-your-design-code) of the "Custom sign-up and sign-in pages" page for more information.

## Handle redirect

Once your user is redirected back to your site from Kinde (it means you’ve logged in successfully), use the `getToken` method from `KindeSDKAPI` class to get a user token from Kinde.
Expand Down Expand Up @@ -633,13 +668,17 @@ Constructs redirect url and sends user to Kinde to sign in.
Arguments:

```swift
orgCode?: String
orgCode?: String,
loginHint?: String,
connectionId?: String
```

Usage:

```swift
KindeSDKAPI.auth.login(); or KindeSDKAPI.auth.login(orgCode: “your organization code”) //
KindeSDKAPI.auth.login(); 
// or 
KindeSDKAPI.auth.login(orgCode: “your organization code”)
```

Allow `orgCode` to be provided if a specific org is signed in to.
Expand All @@ -651,16 +690,22 @@ Constructs redirect url and sends user to Kinde to sign up.
Arguments:

```swift
orgCode?: String
orgCode?: String,
loginHint?: String,
planInterest?: String,
pricingTableKey?: String,
connectionId?: String
```

Usage:

```swift
KindeSDKAPI.auth.register(); or KindeSDKAPI.auth.register(orgCode: “your organization code”) //
KindeSDKAPI.auth.register();
// or
KindeSDKAPI.auth.register(orgCode: “your organization code”)
```

Allow `orgCode` to be provided if a specific org is registered to.
Allow `orgCode` to be provided if a specific org is registered to.

### `enablePrivateAuthSession`

Expand Down Expand Up @@ -705,7 +750,8 @@ Constructs a redirect URL and sends the user to Kinde to sign up and create a ne
Arguments:

```swift
orgName: String
orgName: String,
connectionId?: String
```

Usage:
Expand Down