client.authenticateUsingOauth()

This method allows you to sign in using an OAuth bearer token and optional UDID.

Definition

client.authenticateUsingOauth(
bearerToken: string,
options: ?Object,
):Promise<Session,Error>

Parameters

ParameterTypeDescription
bearerTokenstringThe user's OAuth bearer token

Options

ParameterTypeDescription
udid?stringAn optional device identifier; if none is provided, a random one will be generated

Returns

An error will be thrown if any of the arguments are invalid.

Otherwise, once the returned Promise is resolved, we will have access to a partial User with some fields missing.

Example

const user = await client.authenticateUsingOauth('bearer-token', { udid: 'a-udid' });
console.log('Signed in as', user.displayName);