forked from google/GTMAppAuth
-
Notifications
You must be signed in to change notification settings - Fork 0
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
6ef07c7
commit 463efbd
Showing
3 changed files
with
31 additions
and
13 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 |
---|---|---|
|
@@ -24,12 +24,12 @@ | |
#import "OIDFieldMapping.h" | ||
#import "OIDTokenRequest.h" | ||
|
||
NSString *const GTMTVDeviceTokenGrantType = @"http://oauth.net/grant_type/device/1.0"; | ||
NSString *const GTMTVDeviceTokenGrantType = @"urn:ietf:params:oauth:grant-type:device_code"; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
/*! @brief The key for the @c verificationURL property in the incoming parameters and for | ||
@c NSSecureCoding. | ||
*/ | ||
static NSString *const kVerificationURLKey = @"verification_url"; | ||
static NSString *const kVerificationURLKey = @"verification_uri"; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
/*! @brief The key for the @c userCode property in the incoming parameters and for | ||
@c NSSecureCoding. | ||
|
@@ -154,7 +154,7 @@ - (OIDTokenRequest *)tokenPollRequestWithAdditionalParameters: | |
scopes:nil | ||
refreshToken:nil | ||
codeVerifier:nil | ||
additionalParameters:nil]; | ||
additionalParameters:@{@"device_code": _deviceCode}]; | ||
This comment has been minimized.
Sorry, something went wrong.
WilliamDenniss
Author
Owner
|
||
return pollRequest; | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -186,6 +186,10 @@ + (GTMTVAuthorizationCancelBlock)authorizeTVRequest:(GTMTVAuthorizationRequest * | |
// Starting polling interval (may be increased if a slow down message is received). | ||
__block NSTimeInterval interval = [TVAuthorizationResponse.interval doubleValue]; | ||
|
||
interval = MAX(interval, 5); | ||
|
||
// TODO: default interval | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
WilliamDenniss
Author
Owner
|
||
// Polls the token endpoint until the authorization completes or expires. | ||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | ||
do { | ||
|
@@ -196,6 +200,8 @@ + (GTMTVAuthorizationCancelBlock)authorizeTVRequest:(GTMTVAuthorizationRequest * | |
break; | ||
} | ||
|
||
NSLog(@"Poll request: %@", pollRequest); | ||
|
||
// Polls token endpoint. | ||
[OIDAuthorizationService performTokenRequest:pollRequest | ||
callback:^(OIDTokenResponse *_Nullable tokenResponse, | ||
|
This is the new RFC defined grant type