AppAuth
OIDAuthorizationService.h
Go to the documentation of this file.
1 
19 #import <Foundation/Foundation.h>
20 
21 @class OIDAuthorization;
29 @class OIDTokenRequest;
30 @class OIDTokenResponse;
31 @protocol OIDExternalUserAgent;
33 
34 NS_ASSUME_NONNULL_BEGIN
35 
41 typedef void (^OIDDiscoveryCallback)(OIDServiceConfiguration *_Nullable configuration,
42  NSError *_Nullable error);
43 
49 typedef void (^OIDAuthorizationCallback)(OIDAuthorizationResponse *_Nullable authorizationResponse,
50  NSError *_Nullable error);
51 
56 typedef void (^OIDEndSessionCallback)(OIDEndSessionResponse *_Nullable endSessionResponse,
57  NSError *_Nullable error);
58 
64 typedef void (^OIDTokenCallback)(OIDTokenResponse *_Nullable tokenResponse,
65  NSError *_Nullable error);
66 
70 typedef NSDictionary<NSString *, NSString *> *_Nullable OIDTokenEndpointParameters;
71 
77 typedef void (^OIDRegistrationCompletion)(OIDRegistrationResponse *_Nullable registrationResponse,
78  NSError *_Nullable error);
79 
83 @interface OIDAuthorizationService : NSObject
84 
91 @property(nonatomic, readonly) OIDServiceConfiguration *configuration;
92 
96 - (instancetype)init NS_UNAVAILABLE;
97 
105 + (void)discoverServiceConfigurationForIssuer:(NSURL *)issuerURL
106  completion:(OIDDiscoveryCallback)completion;
107 
108 
116 + (void)discoverServiceConfigurationForDiscoveryURL:(NSURL *)discoveryURL
117  completion:(OIDDiscoveryCallback)completion;
118 
128 + (id<OIDExternalUserAgentSession>) presentAuthorizationRequest:(OIDAuthorizationRequest *)request
129  externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
130  callback:(OIDAuthorizationCallback)callback;
131 
141 + (id<OIDExternalUserAgentSession>)
142  presentEndSessionRequest:(OIDEndSessionRequest *)request
143  externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
144  callback:(OIDEndSessionCallback)callback;
145 
150 + (void)performTokenRequest:(OIDTokenRequest *)request callback:(OIDTokenCallback)callback;
151 
157 + (void)performTokenRequest:(OIDTokenRequest *)request
158  originalAuthorizationResponse:(OIDAuthorizationResponse *_Nullable)authorizationResponse
159  callback:(OIDTokenCallback)callback;
160 
165 + (void)performRegistrationRequest:(OIDRegistrationRequest *)request
166  completion:(OIDRegistrationCompletion)completion;
167 
168 @end
169 
170 NS_ASSUME_NONNULL_END
OIDServiceConfiguration
Represents the information needed to construct a OIDAuthorizationService.
Definition: OIDServiceConfiguration.h:35
OIDRegistrationCompletion
void(^ OIDRegistrationCompletion)(OIDRegistrationResponse *_Nullable registrationResponse, NSError *_Nullable error)
Represents the type of block used as a callback for various methods of OIDAuthorizationService.
Definition: OIDAuthorizationService.h:77
OIDAuthorizationResponse
Represents the response to an authorization request.
Definition: OIDAuthorizationResponse.h:31
OIDRegistrationRequest
Represents a registration request.
Definition: OIDRegistrationRequest.h:29
OIDAuthorizationRequest
Represents an authorization request.
Definition: OIDAuthorizationRequest.h:41
OIDAuthorizationCallback
void(^ OIDAuthorizationCallback)(OIDAuthorizationResponse *_Nullable authorizationResponse, NSError *_Nullable error)
Represents the type of block used as a callback for various methods of OIDAuthorizationService.
Definition: OIDAuthorizationService.h:49
OIDEndSessionRequest
Definition: OIDEndSessionRequest.h:27
OIDEndSessionResponse
Represents the response to an End Session request.
Definition: OIDEndSessionResponse.h:29
OIDTokenCallback
void(^ OIDTokenCallback)(OIDTokenResponse *_Nullable tokenResponse, NSError *_Nullable error)
Represents the type of block used as a callback for various methods of OIDAuthorizationService.
Definition: OIDAuthorizationService.h:64
OIDTokenEndpointParameters
NSDictionary< NSString *, NSString * > *_Nullable OIDTokenEndpointParameters
Represents the type of dictionary used to specify additional querystring parameters when making autho...
Definition: OIDAuthorizationService.h:70
OIDRegistrationResponse
Represents a registration response.
Definition: OIDRegistrationResponse.h:53
OIDExternalUserAgentSession-p
Represents an in-flight external user-agent session.
Definition: OIDExternalUserAgentSession.h:23
OIDAuthorizationService
Performs various OAuth and OpenID Connect related calls via the user agent or NSURLSession.
Definition: OIDAuthorizationService.h:83
OIDDiscoveryCallback
void(^ OIDDiscoveryCallback)(OIDServiceConfiguration *_Nullable configuration, NSError *_Nullable error)
Represents the type of block used as a callback for creating a service configuration from a remote Op...
Definition: OIDAuthorizationService.h:41
OIDTokenRequest
Represents a token request.
Definition: OIDTokenRequest.h:34
OIDEndSessionCallback
void(^ OIDEndSessionCallback)(OIDEndSessionResponse *_Nullable endSessionResponse, NSError *_Nullable error)
Block used as a callback for the end-session request of OIDAuthorizationService.
Definition: OIDAuthorizationService.h:56
OIDAuthorizationService::configuration
OIDServiceConfiguration * configuration
The service's configuration.
Definition: OIDAuthorizationService.h:91
OIDTokenResponse
Represents the response to an token request.
Definition: OIDTokenResponse.h:29
OIDExternalUserAgent-p
An external user-agent UI that presents displays the request to the user. Clients may provide custom ...
Definition: OIDExternalUserAgent.h:31