AppAuth: OIDAuthState(IOS) Category Reference (original) (raw)

iOS specific convenience methods for [OIDAuthState](interface%5Fo%5Fi%5Fd%5Fauth%5Fstate.html "A convenience class that retains the auth state between OIDAuthorizationResponses and OIDTokenRespons..."). More...

#import <[OIDAuthState+IOS.h](%5Fo%5Fi%5Fd%5Fauth%5Fstate%5F09%5Fi%5Fo%5Fs%5F8h%5Fsource.html)>

Class Methods
(id< OIDExternalUserAgentSession >) + authStateByPresentingAuthorizationRequest:presentingViewController:callback:
Convenience method to create a OIDAuthState by presenting an authorization request and performing the authorization code exchange in the case of code flow requests. For the hybrid flow, the caller should validate the id_token and c_hash, then perform the token request (performTokenRequest:callback: (OIDAuthorizationService)) and update the OIDAuthState with the results (updateWithTokenResponse:error: (OIDAuthState)). More...

Detailed Description

iOS specific convenience methods for [OIDAuthState](interface%5Fo%5Fi%5Fd%5Fauth%5Fstate.html "A convenience class that retains the auth state between OIDAuthorizationResponses and OIDTokenRespons...").

Method Documentation

authStateByPresentingAuthorizationRequest:presentingViewController:callback:()

+ (id<OIDExternalUserAgentSession>) authStateByPresentingAuthorizationRequest: (OIDAuthorizationRequest *) authorizationRequest
presentingViewController: (UIViewController *) presentingViewController
callback: (OIDAuthStateAuthorizationCallback) callback

Convenience method to create a [OIDAuthState](interface%5Fo%5Fi%5Fd%5Fauth%5Fstate.html "A convenience class that retains the auth state between OIDAuthorizationResponses and OIDTokenRespons...") by presenting an authorization request and performing the authorization code exchange in the case of code flow requests. For the hybrid flow, the caller should validate the id_token and c_hash, then perform the token request ([performTokenRequest:callback: (OIDAuthorizationService)](interface%5Fo%5Fi%5Fd%5Fauthorization%5Fservice.html#aedf588e591cd38c97b222b58522fc758 "Performs a token request.")) and update the OIDAuthState with the results ([updateWithTokenResponse:error: (OIDAuthState)](interface%5Fo%5Fi%5Fd%5Fauth%5Fstate.html#a9c6c644e2de68c997b9591156b2e0aa9 "Updates the authorization state based on a new token response.")).

Parameters

authorizationRequest The authorization request to present.
presentingViewController The view controller from which to present the SFSafariViewController. On iOS 13, the window of this UIViewController is used as the ASPresentationAnchor.
callback The method called when the request has completed or failed.

Returns

A [OIDExternalUserAgentSession](protocol%5Fo%5Fi%5Fd%5Fexternal%5Fuser%5Fagent%5Fsession-p.html "Represents an in-flight external user-agent session.") instance which will terminate when it receives a [cancel (OIDExternalUserAgentSession-p)](protocol%5Fo%5Fi%5Fd%5Fexternal%5Fuser%5Fagent%5Fsession-p.html#a7c53f5b5c6dc3d37bf9b32ba026bed8d "Cancels the code flow session, invoking the request's callback with a cancelled error.") message, or after processing a [resumeExternalUserAgentFlowWithURL: (OIDExternalUserAgentSession-p)](protocol%5Fo%5Fi%5Fd%5Fexternal%5Fuser%5Fagent%5Fsession-p.html#aa7cf358254e4e7cf55fd064ecd08cd2b "Clients should call this method with the result of the external user-agent code flow if it becomes av...") message.

Extends class OIDAuthState.


The documentation for this category was generated from the following file: