Skip to content

Commit

Permalink
Merge pull request #63 from sowmiya/master
Browse files Browse the repository at this point in the history
Passing a generated nonce string in app to app authentication flow
  • Loading branch information
sowmiya committed Aug 17, 2015
2 parents 088f1d0 + 6a863f9 commit c20376c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ - (void)presentDefaultAuthenticationWithCompletionBlock:(void (^)(BOXUser *user,
clientID:self.OAuth2Session.clientID
URLScheme:authURLScheme
authRedirectURIString:self.OAuth2Session.redirectURIString];
BoxAppToAppMessage *authMessage = [BoxAppToAppMessage boxAppAuthorizationMessageWithState:nil currentApplication:currentApplication];
BoxAppToAppMessage *authMessage = [BoxAppToAppMessage boxAppAuthorizationMessageWithState:self.OAuth2Session.nonce
currentApplication:currentApplication];
BoxAppToAppStatus messageDidSend = [authMessage execute];

didPresentDefaultAuthentication = (messageDidSend == BoxAppToAppStatusSuccess);
Expand Down
6 changes: 6 additions & 0 deletions BoxContentSDK/BoxContentSDK/OAuth2/BOXOAuth2Session.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@
*/
- (NSString *)redirectURIString;

/**
* Returns the randomly generated nonce used to prevent spoofing attack during login
* @return generated nonce
*/
- (NSString *)nonce;

#pragma mark - Token Refresh
/** @name Token Refresh */

Expand Down

0 comments on commit c20376c

Please sign in to comment.