Last active
October 30, 2015 23:57
-
-
Save ksylvest/d05c1aeee84658338c37 to your computer and use it in GitHub Desktop.
Layer Authentication Idea
This file contains hidden or 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
LYRLayer *client = [LYRLayer new]; | |
NSString *userID = @"..."; | |
LYRLayerNonceAuthenticationChallenge nac = ^(NSString *nonce, LYRLayerNonceAuthenticationChallengeCompletion completion) { | |
// The integrator would fill make the approriate server calls here then call the completion block with a token or NULL if a problem occurred. | |
// [ get:@"/layer/authenticate" completion:^(NSDictionary *parameters){ | |
// completion(parameters["layer_identity_token"]); | |
// }]; | |
}; | |
[client autoConnectAndAuthenticateUserID:userID withNonceAuthenticationChallenge:nac completion:^(NSError *error){ | |
// Hurray - user is connected and authenticated. | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment