OAuthToken
OAuth token
Operations
FormatNewToken
Formats a new token
function : FormatNewToken(access_token:String, expires_in:Int) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| access_token | String | access token |
| expires_in | Int | expiration time |
Return
| Type | Description |
|---|---|
| String | formatted token string |
GetAccessToken
Get access token
method : public : GetAccessToken() ~ StringReturn
| Type | Description |
|---|---|
| String | access token |
GetExpiresIn
Get expiration time
method : public : GetExpiresIn() ~ IntReturn
| Type | Description |
|---|---|
| Int | expiration time |
GetRefreshToken
Get refresh token
method : public : GetRefreshToken() ~ StringReturn
| Type | Description |
|---|---|
| String | refresh token |
New
Constructor
New(access_token:String, refresh_token:String, expires_in:Int, scope:String)Parameters
| Name | Type | Description |
|---|---|---|
| access_token | String | access token |
| refresh_token | String | refresh token |
| expires_in | Int | expiration time |
| scope | String | token scope |
ReadTokenFormat
Reads and validates token format
function : ReadTokenFormat(secret_str:String) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| secret_str | String | secret string |
Return
| Type | Description |
|---|---|
| String | token if valid, Nil otherwise |
Set
Sets the token values
method : public : Set(access_token:String, expires_in:Int, scope:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| access_token | String | access token |
| expires_in | Int | expiration time |
| scope | String | token scope |
ToString
Get token as string
method : public : ToString() ~ StringReturn
| Type | Description |
|---|---|
| String | token as string |