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
Parameter | Type | Description |
---|---|---|
bearerToken | string | The user's OAuth bearer token |
Options
Parameter | Type | Description |
---|---|---|
udid | ?string | An 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);