AppAuth
OIDAuthorizationRequest.h
Go to the documentation of this file.
1 
19 #import <Foundation/Foundation.h>
20 
21 // These files only declare string constants useful for constructing a @c OIDAuthorizationRequest,
22 // so they are imported here for convenience.
23 #import "OIDExternalUserAgentRequest.h"
24 #import "OIDResponseTypes.h"
25 #import "OIDScopes.h"
26 
28 
29 NS_ASSUME_NONNULL_BEGIN
30 
35 
36 
42  NSObject<NSCopying, NSSecureCoding, OIDExternalUserAgentRequest>
43 
48 @property(nonatomic, readonly) OIDServiceConfiguration *configuration;
49 
57 @property(nonatomic, readonly) NSString *responseType;
58 
63 @property(nonatomic, readonly) NSString *clientID;
64 
73 @property(nonatomic, readonly, nullable) NSString *clientSecret;
74 
80 @property(nonatomic, readonly, nullable) NSString *scope;
81 
86 @property(nonatomic, readonly, nullable) NSURL *redirectURL;
87 
97 @property(nonatomic, readonly, nullable) NSString *state;
98 
108 @property(nonatomic, readonly, nullable) NSString *nonce;
109 
118 @property(nonatomic, readonly, nullable) NSString *codeVerifier;
119 
124 @property(nonatomic, readonly, nullable) NSString *codeChallenge;
125 
130 @property(nonatomic, readonly, nullable) NSString *codeChallengeMethod;
131 
135 @property(nonatomic, readonly, nullable) NSDictionary<NSString *, NSString *> *additionalParameters;
136 
141 - (instancetype)init NS_UNAVAILABLE;
142 
154 - (instancetype)
155  initWithConfiguration:(OIDServiceConfiguration *)configuration
156  clientId:(NSString *)clientID
157  scopes:(nullable NSArray<NSString *> *)scopes
158  redirectURL:(NSURL *)redirectURL
159  responseType:(NSString *)responseType
160  additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters;
161 
174 - (instancetype)
175  initWithConfiguration:(OIDServiceConfiguration *)configuration
176  clientId:(NSString *)clientID
177  clientSecret:(nullable NSString *)clientSecret
178  scopes:(nullable NSArray<NSString *> *)scopes
179  redirectURL:(NSURL *)redirectURL
180  responseType:(NSString *)responseType
181  additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters;
182 
203 - (instancetype)
204  initWithConfiguration:(OIDServiceConfiguration *)configuration
205  clientId:(NSString *)clientID
206  clientSecret:(nullable NSString *)clientSecret
207  scope:(nullable NSString *)scope
208  redirectURL:(nullable NSURL *)redirectURL
209  responseType:(NSString *)responseType
210  state:(nullable NSString *)state
211  nonce:(nullable NSString *)nonce
212  codeVerifier:(nullable NSString *)codeVerifier
213  codeChallenge:(nullable NSString *)codeChallenge
214  codeChallengeMethod:(nullable NSString *)codeChallengeMethod
215  additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters
216  NS_DESIGNATED_INITIALIZER;
217 
223 - (NSURL *)authorizationRequestURL;
224 
229 + (nullable NSString *)generateState;
230 
235 + (nullable NSString *)generateCodeVerifier;
236 
246 + (nullable NSString *)codeChallengeS256ForVerifier:(nullable NSString *)codeVerifier;
247 
248 @end
249 
250 NS_ASSUME_NONNULL_END
OIDServiceConfiguration
Represents the information needed to construct a OIDAuthorizationService.
Definition: OIDServiceConfiguration.h:35
OIDAuthorizationRequest::redirectURL
NSURL * redirectURL
The client's redirect URI.
Definition: OIDAuthorizationRequest.h:86
OIDAuthorizationRequest::state
NSString * state
An opaque value used by the client to maintain state between the request and callback.
Definition: OIDAuthorizationRequest.h:97
OIDAuthorizationRequest::codeChallengeMethod
NSString * codeChallengeMethod
The method used to compute the codeChallenge.
Definition: OIDAuthorizationRequest.h:130
OIDAuthorizationRequest
Represents an authorization request.
Definition: OIDAuthorizationRequest.h:41
OIDAuthorizationRequest::codeVerifier
NSString * codeVerifier
The PKCE code verifier.
Definition: OIDAuthorizationRequest.h:118
OIDOAuthorizationRequestCodeChallengeMethodS256
NSString *const OIDOAuthorizationRequestCodeChallengeMethodS256
The code_challenge_method value for the S256 code challenge.
OIDAuthorizationRequest::responseType
NSString * responseType
The expected response type.
Definition: OIDAuthorizationRequest.h:57
OIDAuthorizationRequest::additionalParameters
NSDictionary< NSString *, NSString * > * additionalParameters
The client's additional authorization parameters.
Definition: OIDAuthorizationRequest.h:135
OIDExternalUserAgentRequest-p
Definition: OIDExternalUserAgentRequest.h:23
OIDAuthorizationRequest::codeChallenge
NSString * codeChallenge
The PKCE code challenge, derived from codeVerifier.
Definition: OIDAuthorizationRequest.h:124
OIDScopes.h
AppAuth iOS SDK.
OIDAuthorizationRequest::nonce
NSString * nonce
String value used to associate a Client session with an ID Token, and to mitigate replay attacks....
Definition: OIDAuthorizationRequest.h:108
+[OIDAuthorizationRequest generateState]
nullable NSString * generateState()
Generates an OAuth state param using a random source.
OIDAuthorizationRequest::scope
NSString * scope
The value of the scope parameter is expressed as a list of space-delimited, case-sensitive strings.
Definition: OIDAuthorizationRequest.h:80
-[OIDAuthorizationRequest authorizationRequestURL]
NSURL * authorizationRequestURL()
Constructs the request URI by adding the request parameters to the query component of the authorizati...
OIDAuthorizationRequest::configuration
OIDServiceConfiguration * configuration
The service's configuration.
Definition: OIDAuthorizationRequest.h:48
OIDAuthorizationRequest::clientSecret
NSString * clientSecret
The client secret.
Definition: OIDAuthorizationRequest.h:73
OIDResponseTypes.h
AppAuth iOS SDK.
+[OIDAuthorizationRequest generateCodeVerifier]
nullable NSString * generateCodeVerifier()
Constructs a PKCE-compliant code verifier.
OIDAuthorizationRequest::clientID
NSString * clientID
The client identifier.
Definition: OIDAuthorizationRequest.h:63