Skip to content

Instantly share code, notes, and snippets.

@robotdan
Last active May 25, 2016 14:29
Show Gist options
  • Save robotdan/abdf7f1e457e7ad4fd26a7856b5823f1 to your computer and use it in GitHub Desktop.
Save robotdan/abdf7f1e457e7ad4fd26a7856b5823f1 to your computer and use it in GitHub Desktop.
PassportClient Code Snippets
/* Authenticate a User */
ClientResponse<LoginResponse, Errors> response = client.Login(
new LoginRequest(new Guid("00000000-0000-0000-0000-00000000002a"), "[email protected]", null, "secret"), null);
User user = response.successResponse.user;
/* Retrieve User by Email Address */
ClientResponse<UserResponse, Errors> response = client.RetrieveUserByEmail("[email protected]");
User user = response.successResponse.user;
/* Authenticate a User */
ClientResponse<UserResponse, Errors> response = client.login(
new LoginRequest(UUID.fromString("00000000-0000-0000-0000-00000000002a"), "[email protected]", null, "secret"), null);
User user = response.successResponse.user;
/* Retrieve User by Email Address */
ClientResponse<UserResponse, Errors> response = client.retrieveUserByEmail("[email protected]");
User user = response.successResponse.user;
// Authenticate a User
client.login({
'applicationId': '00000000-0000-0000-0000-00000000002a',
'email': '[email protected]',
'password', 'secret'
}).then((clientResponse) => {
var user = clientResponse.successResponse.user;
// ...
});
// Retrieve User by Email Address
client.retrieveUserByEmail('[email protected]').then((clientResponse) => {
var user = clientResponse.successResponse.user;
// ...
});
/* Authenticate a User */
$response = client->login(
["applicationId" => "00000000-0000-0000-0000-00000000002a", "email" => "[email protected]", "password" => "secret"]
);
$user = $response->successResponse->user;
/* Retrieve User by Email Address */
$response = client->retrieveUserByEmail("[email protected]");
$user = $response->successResponse->user;
# Authentication
response = client.login({
'applicationId': '00000000-0000-0000-0000-00000000002a',
'email': '[email protected]',
'password', 'secret'
})
user = response.success_response.user
# Retrieve User by Email Address
response = client.retrieve_user_by_email('[email protected]')
user = response.success_response.user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment