Skip to content

Instantly share code, notes, and snippets.

@robotdan
Last active May 25, 2016 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • 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"), "bob@example.com", null, "secret"), null);
User user = response.successResponse.user;
/* Retrieve User by Email Address */
ClientResponse<UserResponse, Errors> response = client.RetrieveUserByEmail("bob@example.com");
User user = response.successResponse.user;
/* Authenticate a User */
ClientResponse<UserResponse, Errors> response = client.login(
new LoginRequest(UUID.fromString("00000000-0000-0000-0000-00000000002a"), "bob@example.com", null, "secret"), null);
User user = response.successResponse.user;
/* Retrieve User by Email Address */
ClientResponse<UserResponse, Errors> response = client.retrieveUserByEmail("bob@example.com");
User user = response.successResponse.user;
// Authenticate a User
client.login({
'applicationId': '00000000-0000-0000-0000-00000000002a',
'email': 'bob@example.com',
'password', 'secret'
}).then((clientResponse) => {
var user = clientResponse.successResponse.user;
// ...
});
// Retrieve User by Email Address
client.retrieveUserByEmail('bob@example.com').then((clientResponse) => {
var user = clientResponse.successResponse.user;
// ...
});
/* Authenticate a User */
$response = client->login(
["applicationId" => "00000000-0000-0000-0000-00000000002a", "email" => "bob@example.com", "password" => "secret"]
);
$user = $response->successResponse->user;
/* Retrieve User by Email Address */
$response = client->retrieveUserByEmail("bob@example.com");
$user = $response->successResponse->user;
# Authentication
response = client.login({
'applicationId': '00000000-0000-0000-0000-00000000002a',
'email': 'bob@example.com',
'password', 'secret'
})
user = response.success_response.user
# Retrieve User by Email Address
response = client.retrieve_user_by_email('bob@example.com')
user = response.success_response.user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment