Add sign-in using the OAuth 2.0 device authorization grant flow to your tvOS app.
The Okta Client SDK for Swift provides a number of utility classes that manage standard sign-on flows. The DeviceAuthorizationFlow class manages the OAuth 2.0 device authorization code flow.
The sample contains two different targets:
- DeviceAuthSignIn(tvOS): The tvOS app that implements the sign-in flow.
- DeviceAuthSignIn(iOS): An implementation of the app on iOS used for automated testing.
Add the issuer URL for your Okta org and the client ID for your Okta Application Integration to the tvOS app to the file DeviceAuthSignIn (tvOS) > DeviceAuthSignIn > ViewController.swift. There are two placeholders in that file:
domain: The domain of your registered Okta org followed by/oauth2/default, such ashttps://dev-1234567.okta.com/oauth2/default.client_id: The client ID from the Application Integration in the Okta Admin console, such as0ux3rutxocxFX9xyz3t9.
- OktaBrowserSignIn > OAuth2Auth > Introduction to Authentication Flows in the Okta Client SDK documentation.
- For information on configuring the device authorization grant flow in your Okta Admin Console, see Configure Device Authorization Grant Flow.
- Okta Client SDK for Swift