Skip to content

Instantly share code, notes, and snippets.

@ksylvest
Last active October 30, 2015 23:57
Show Gist options
  • Save ksylvest/d05c1aeee84658338c37 to your computer and use it in GitHub Desktop.
Save ksylvest/d05c1aeee84658338c37 to your computer and use it in GitHub Desktop.
Layer Authentication Idea
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