forked from okta/okta-oidc-ios
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20ab56d
commit 02d5718
Showing
63 changed files
with
901 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/*! @file AppAuth.h | ||
@brief AppAuth iOS SDK | ||
@copyright | ||
Copyright 2015 Google Inc. All Rights Reserved. | ||
@copydetails | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#import "OIDAuthState.h" | ||
#import "OIDAuthStateChangeDelegate.h" | ||
#import "OIDAuthStateErrorDelegate.h" | ||
#import "OIDAuthorizationRequest.h" | ||
#import "OIDAuthorizationResponse.h" | ||
#import "OIDAuthorizationService.h" | ||
#import "OIDError.h" | ||
#import "OIDErrorUtilities.h" | ||
#import "OIDExternalUserAgent.h" | ||
#import "OIDExternalUserAgentRequest.h" | ||
#import "OIDExternalUserAgentSession.h" | ||
#import "OIDGrantTypes.h" | ||
#import "OIDIDToken.h" | ||
#import "OIDRegistrationRequest.h" | ||
#import "OIDRegistrationResponse.h" | ||
#import "OIDResponseTypes.h" | ||
#import "OIDScopes.h" | ||
#import "OIDScopeUtilities.h" | ||
#import "OIDServiceConfiguration.h" | ||
#import "OIDServiceDiscovery.h" | ||
#import "OIDTokenRequest.h" | ||
#import "OIDTokenResponse.h" | ||
#import "OIDTokenUtilities.h" | ||
#import "OIDURLSessionProvider.h" | ||
|
||
#if TARGET_OS_TV | ||
#elif TARGET_OS_WATCH | ||
#elif TARGET_OS_IOS | ||
#import "OIDAuthState+IOS.h" | ||
#import "OIDAuthorizationService+IOS.h" | ||
#import "OIDExternalUserAgentIOS.h" | ||
#import "OIDExternalUserAgentIOSCustomBrowser.h" | ||
#elif TARGET_OS_MAC | ||
#import "OIDAuthState+Mac.h" | ||
#import "OIDAuthorizationService+Mac.h" | ||
#import "OIDExternalUserAgentMac.h" | ||
#import "OIDRedirectHTTPHandler.h" | ||
#else | ||
#error "Platform Undefined" | ||
#endif | ||
|
||
/*! @mainpage AppAuth for iOS and macOS | ||
@section introduction Introduction | ||
AppAuth for iOS and macOS is a client SDK for communicating with [OAuth 2.0] | ||
(https://tools.ietf.org/html/rfc6749) and [OpenID Connect] | ||
(http://openid.net/specs/openid-connect-core-1_0.html) providers. It strives to | ||
directly map the requests and responses of those specifications, while following | ||
the idiomatic style of the implementation language. In addition to mapping the | ||
raw protocol flows, convenience methods are available to assist with common | ||
tasks like performing an action with fresh tokens. | ||
It follows the best practices set out in | ||
[RFC 8252 - OAuth 2.0 for Native Apps](https://tools.ietf.org/html/rfc8252) | ||
including using `SFAuthenticationSession` and `SFSafariViewController` on iOS | ||
for the auth request. `UIWebView` and `WKWebView` are explicitly *not* | ||
supported due to the security and usability reasons explained in | ||
[Section 8.12 of RFC 8252](https://tools.ietf.org/html/rfc8252#section-8.12). | ||
It also supports the [PKCE](https://tools.ietf.org/html/rfc7636) extension to | ||
OAuth which was created to secure authorization codes in public clients when | ||
custom URI scheme redirects are used. The library is friendly to other | ||
extensions (standard or otherwise) with the ability to handle additional params | ||
in all protocol requests and responses. | ||
<b>Homepage</b>: http://openid.github.io/AppAuth-iOS/ <br> | ||
<b>API Documentation</b>: http://openid.github.io/AppAuth-iOS/docs/latest <br> | ||
<b>Git Repository</b>: https://github.com/openid/AppAuth-iOS <br> | ||
*/ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/*! @file OIDAuthState+IOS.h | ||
@brief AppAuth iOS SDK | ||
@copyright | ||
Copyright 2016 Google Inc. All Rights Reserved. | ||
@copydetails | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
#import "OIDAuthState.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/*! @brief iOS specific convenience methods for @c OIDAuthState. | ||
*/ | ||
@interface OIDAuthState (IOS) | ||
|
||
/*! @brief Convenience method to create a @c 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 (@c OIDAuthorizationService.performTokenRequest:callback:) | ||
and update the OIDAuthState with the results (@c | ||
OIDAuthState.updateWithTokenResponse:error:). | ||
@param authorizationRequest The authorization request to present. | ||
@param presentingViewController The view controller from which to present the | ||
@c SFSafariViewController. | ||
@param callback The method called when the request has completed or failed. | ||
@return A @c OIDExternalUserAgentSession instance which will terminate when it | ||
receives a @c OIDExternalUserAgentSession.cancel message, or after processing a | ||
@c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message. | ||
*/ | ||
+ (id<OIDExternalUserAgentSession>) | ||
authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest | ||
presentingViewController:(UIViewController *)presentingViewController | ||
callback:(OIDAuthStateAuthorizationCallback)callback; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*! @file OIDAuthState+IOS.m | ||
@brief AppAuth iOS SDK | ||
@copyright | ||
Copyright 2016 Google Inc. All Rights Reserved. | ||
@copydetails | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#import "OIDAuthState+IOS.h" | ||
|
||
#import "OIDExternalUserAgentIOS.h" | ||
|
||
@implementation OIDAuthState (IOS) | ||
|
||
+ (id<OIDExternalUserAgentSession>) | ||
authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest | ||
presentingViewController:(UIViewController *)presentingViewController | ||
callback:(OIDAuthStateAuthorizationCallback)callback { | ||
OIDExternalUserAgentIOS *externalUserAgent = | ||
[[OIDExternalUserAgentIOS alloc] | ||
initWithPresentingViewController:presentingViewController]; | ||
return [self authStateByPresentingAuthorizationRequest:authorizationRequest | ||
externalUserAgent:externalUserAgent | ||
callback:callback]; | ||
} | ||
|
||
@end |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/*! @file OIDAuthorizationService+IOS.h | ||
@brief AppAuth iOS SDK | ||
@copyright | ||
Copyright 2016 Google Inc. All Rights Reserved. | ||
@copydetails | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
#import "OIDAuthorizationService.h" | ||
#import "OIDExternalUserAgentSession.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/*! @brief Provides iOS specific authorization request handling. | ||
*/ | ||
@interface OIDAuthorizationService (IOS) | ||
|
||
/*! @brief Perform an authorization flow using \SFSafariViewController. | ||
@param request The authorization request. | ||
@param presentingViewController The view controller from which to present the | ||
\SFSafariViewController. | ||
@param callback The method called when the request has completed or failed. | ||
@return A @c OIDExternalUserAgentSession instance which will terminate when it | ||
receives a @c OIDExternalUserAgentSession.cancel message, or after processing a | ||
@c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message. | ||
*/ | ||
+ (id<OIDExternalUserAgentSession>) presentAuthorizationRequest:(OIDAuthorizationRequest *)request | ||
presentingViewController:(UIViewController *)presentingViewController | ||
callback:(OIDAuthorizationCallback)callback; | ||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*! @file OIDAuthorizationService+IOS.m | ||
@brief AppAuth iOS SDK | ||
@copyright | ||
Copyright 2016 Google Inc. All Rights Reserved. | ||
@copydetails | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#import "OIDAuthorizationService+IOS.h" | ||
|
||
#import "OIDExternalUserAgentIOS.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@implementation OIDAuthorizationService (IOS) | ||
|
||
+ (id<OIDExternalUserAgentSession>) presentAuthorizationRequest:(OIDAuthorizationRequest *)request | ||
presentingViewController:(UIViewController *)presentingViewController | ||
callback:(OIDAuthorizationCallback)callback { | ||
OIDExternalUserAgentIOS *externalUserAgent = [[OIDExternalUserAgentIOS alloc] | ||
initWithPresentingViewController:presentingViewController]; | ||
return [self presentAuthorizationRequest:request externalUserAgent:externalUserAgent callback:callback]; | ||
} | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.