You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/@okta/vuepress-site/docs/guides/sign-into-mobile-app-redirect/main/index.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Add authentication to your mobile app using the Okta [redirect model](https://de
13
13
* Create an integration that represents your app in your Okta org.
14
14
* Add dependencies and configure your mobile app to use Okta.
15
15
* Add a browser-based sign-in flow that Okta controls (redirect authentication).
16
-
* Load the details of the signedin user and check for an existing authenticated session at app startup.
16
+
* Load the details of the signed-in user and check for an existing authenticated session at app startup.
17
17
* Refresh tokens to keep the user signed in.
18
18
* Make server calls using an access token for the session.
19
19
* Test your integration by signing in as a user.
@@ -33,25 +33,26 @@ Make a note of your Okta domain. Use it wherever `${yourOktaDomain}` appears in
33
33
> **Note**: If you're using an existing org, verify that API Access Management is enabled: Open your Admin Console, go to **Security** > **API**, and verify that an **Authorization Servers** tab is present. If not, choose one of the following:
34
34
>
35
35
> * Contact your support team to enable the feature in your org.
36
-
> * Use the Admin Console to create your app integrations instead of the CLI.
36
+
> * Use the Admin Console to create your app integrations.
37
37
>
38
38
39
39
## Create an Okta integration for your app
40
40
41
41
An app integration represents your app in your Okta org. The integration configures how your app integrates with the Okta services. This includes which users and groups have access, authentication policies, token refresh requirements, redirect URLs, and more. The integration includes configuration information required by the app to access Okta.
42
42
43
-
To create your app integration in Okta using the Admin Console:
43
+
To create your app integration in the Okta Admin Console:
44
44
45
-
1.[Sign in to your Okta organization](https://developer.okta.com/login) with your administrator account. Click **Admin** on the top right of the page.
46
-
1.Open the apps configuration pane by selecting**Applications** > **Applications**. Click **Create App Integration**.
45
+
1.[Sign in to your Okta org](https://developer.okta.com/login) with your admin account. Click **Admin** on the top right of the page.
1. Select a **Sign-in method** of **OIDC - OpenID Connect**.
48
-
1. Select an **Application type** of **Native Application**, then click **Next**.
48
+
1. Select an **Application type** of **Native Application**, and then click **Next**.
49
49
> **Note:** If you choose the wrong app type, it can break the sign-in or sign-out flows. Integrations require the verification of a client secret, which public clients don't have.
50
50
1. Enter an **App integration name**.
51
51
1. Enter the callback routes.
52
52
53
53
<StackSnippetsnippet="redirectvalues" />
54
54
55
+
1. Select the type of **Controlled access** for your app in the **Assignments** section. You can allow all users to have access or limit access to individuals and groups. See [Assign app integrations](https://help.okta.com/okta_help.htm?type=oie&id=ext-lcm-user-app-assign).
55
56
1. Click **Save** to update the Okta app settings.
56
57
57
58
## Create an app
@@ -139,7 +140,7 @@ Enable a refresh token in your app integration by following these steps:
139
140
1. Choose **Applications > Applications** to show the app integrations.
140
141
1. Click the name of your integration to open the configuration manager.
141
142
1. Click **Edit** in the **General Settings** section.
142
-
1. Select **Refresh Token**in the **Application** section.
143
+
1. Select **Refresh Token**as the grant type.
143
144
1. Click **Save** at the bottom of the **General Settings** section.
1. Confirm that the `okta-mobile-swift` package is selected, that the **Dependency Rule** is set to the main branch, and that your project is selected.
6
+
1. Confirm that the `okta-mobile-swift` package is selected, that the **Dependency Rule** is set to the master branch, and that your project is selected.
7
+
1. Click **Add Package**.
8
+
1. Select the package products that appear in the dialog: **AuthFoundation**, **OktaOAuth2**, and **BrowserSignin**, click **Add to target**, and select your project.
7
9
1. Click **Add Package**.
8
-
1. Select the package products that appear in the dialog: **AuthFoundation**, **OktaOAuth2**, and **WebAuthenticationUI**, and then click **Add Package**.
9
10
10
11
Open `ContentView.swift` and update the `import` statements to use the authorization foundation and WebAuthn UI libraries:
Copy file name to clipboardExpand all lines: packages/@okta/vuepress-site/docs/guides/sign-into-mobile-app-redirect/main/ios/checkfortoken.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ When you check for an existing session, it may take two steps:
5
5
6
6
The `Credential` class manages the tokens for a user. The `signIn()` function that you wrote in [Open the sign-in page](#open-the-sign-in-page) calls `store(_:)` to save the user's credentials. A session exists if there's a default credential. Although there are calls to check if a credential is expired and to request a refresh, this code uses `refreshIfNeeded()` that only tries to refresh the token if it's expired.
7
7
8
-
Check for an existing session by adding an `.onAppear` modifier above the `.alert` modifier of the main content view:
8
+
Check for an existing session by adding an `.onAppear` modifier above the `.alert(isPresented:){}` modifier of the main content view:
Copy file name to clipboardExpand all lines: packages/@okta/vuepress-site/docs/guides/sign-into-mobile-app-redirect/main/ios/configmid.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
The SDK loads the configuration values from a configuration file (`Okta.plist`) if it exists in your main bundle. You can also specify the values in the code using `WebAuthentication(issuer:clientId:scopes:redirectUri:logoutRedirectUri:additionalParameters:)`.
1
+
The SDK loads the configuration values from a configuration file (`Okta.plist`) if it exists in your main bundle. You can also specify the values in the code using `BrowserSignin(issuer:clientId:scopes:redirectUri:logoutRedirectUri:additionalParameters:)`.
2
2
3
3
Create the Okta configuration file and add the keys and values for your app integration:
Copy file name to clipboardExpand all lines: packages/@okta/vuepress-site/docs/guides/sign-into-mobile-app-redirect/main/ios/refresh.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
You refreshed a token when checking for an existing session in [Check for a session at startup](#check-for-a-session-at-startup). In this case you may want to catch any errors that occur.
2
2
3
-
Update `refreshToken` in `ContentView.swift` with the following code:
3
+
Update the `refreshToken` function in `ContentView.swift` with the following code:
4
4
5
5
```swift
6
6
funcrefreshToken() {
@@ -29,7 +29,7 @@ Tokens are refreshed regularly. Each refresh requires network activity, which is
29
29
* Check if the device is using cellular data rather than Wi-Fi.
30
30
* Handle failed refresh attempts, especially when the server can't be reached.
31
31
32
-
The `Token` class contains information such as expiry date. The following function displays the access token, its issue and expiry dates, and any associated refresh token in the info area:
32
+
Update the `showTokenInfo` function in `ContentView.swift` with the following code:
0 commit comments