Skip to content

Commit

Permalink
Update LIALinkedInAuthorizationViewController.m
Browse files Browse the repository at this point in the history
As of today, the receivedState parameter has extra characters appended to it, and therefore does not match the original state.  

For example, my state is "ABCDE"
The returned state is "ABCDE#!"

This fix keeps the state matching in tact in case extra chars are appended to the end.
  • Loading branch information
adamcjohnson committed May 26, 2016
1 parent ccf8e34 commit 9441128
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IOSLinkedInAPI/LIALinkedInAuthorizationViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
} else {
NSString *receivedState = [self extractGetParameter:@"state" fromURLString: url];
//assert that the state is as we expected it to be
if ([self.application.state isEqualToString:receivedState]) {
if ([receivedState containsString:self.application.state]) {
//extract the code from the url
NSString *authorizationCode = [self extractGetParameter:@"code" fromURLString: url];
self.successCallback(authorizationCode);
Expand Down

0 comments on commit 9441128

Please sign in to comment.