BearerToken Property  
 

Gets and sets the OAuth 2.0 bearer token for the current user.

Syntax

object.BearerToken [= token ]

Remarks

The BearerToken property specifies the OAuth 2.0 bearer token used to authenticate the user. Assigning a value to this property will change the current authentication method to use OAuth 2.0 if necessary.

Your application should not store a bearer token for later use. They have a relatively short lifespan, typically about an hour, and are designed to be used with that session. You should specify offline access as part of the OAuth 2.0 scope if necessary and store the refresh token provided by the service. The refresh token has a much longer validity period and can be used to obtain a new bearer token when needed.

If the current authentication method does not use OAuth 2.0, this property will return an empty string and you should check the value of the Password property to obtain the current user's password. Refer to the AuthType property for more information on the available authentication methods.

Data Type

String

See Also

AuthType Property, Password Property, UserName Property, Authenticate Method, Connect Method