oauth_clients
Creates, updates, deletes, gets or lists an oauth_clients
resource.
Overview
Name | oauth_clients |
Type | Resource |
Id | linode.account.oauth_clients |
Fields
The following fields are returned by SELECT
queries:
- get_client
- get_clients
Information about the requested client.
Name | Datatype | Description |
---|---|---|
id | string | Read-only The OAuth Client ID. This is used to identify the client, and is a publicly known value (it is not a secret). (example: 2737bf16b39ab5d7b4a1) |
label | string | Filterable The name of this application. This will be presented to users when they are asked to grant it access to their Account. (example: Test_Client_1) |
public | boolean | Filterable If this is a public or private OAuth Client. Public clients have a slightly different authentication workflow than private clients. See the OAuth spec for more details. |
redirect_uri | string (url) | The location a successful log in from login.linode.com should be redirected to for this client. The receiver of this redirect should be ready to accept an OAuth exchange code and finish the OAuth exchange. (example: https://example.org/oauth/callback) |
secret | string | Read-only The OAuth Client secret, used in the OAuth exchange. This is returned as <REDACTED> except when an OAuth Client is created or its secret is reset. This is a secret, and should not be shared or disclosed publicly. (example: <REDACTED>) |
status | string | Read-only The status of this application. active by default. (example: active) |
thumbnail_url | string (url) | Read-only The URL where this client's thumbnail may be viewed, or null if this client does not have a thumbnail set. (example: https://api.linode.com/v4/account/clients/2737bf16b39ab5d7b4a1/thumbnail) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_client | select | Returns information about a single OAuth client. Learn more... Learn more... | ||
get_clients | select | page , page_size | Returns a paginated list of OAuth Clients registered to your Account. OAuth Clients allow users to log into applications you write or host using their Linode Account, and may allow them to grant some level of access to their Linodes or other entities to your application. Learn more... Learn more... | |
post_client | insert | data__label , data__redirect_uri | Creates an OAuth Client, which can be used to allow users (using their Linode account) to log in to your own application, and optionally grant your application some amount of access to their Linodes or other entities. Learn more... Learn more... | |
put_client | replace | Update information about an OAuth Client on your Account. This can be especially useful to update the redirect_uri of your client in the event that the callback URL changed in your application.Learn more... Learn more... | ||
delete_client | delete | Deletes an OAuth Client registered with Linode. The Client ID and Client secret will no longer be accepted by login.linode.com, and all tokens issued to this client will be invalidated (meaning that if your application was using a token, it will no longer work). Learn more... Learn more... | ||
post_reset_client_secret | exec | Resets the OAuth Client secret for a client you own, and returns the OAuth Client with the plaintext secret. This secret is not supposed to be publicly known or disclosed anywhere. This can be used to generate a new secret in case the one you have has been leaked, or to get a new secret if you lost the original. The old secret is expired immediately, and logins to your client with the old secret will fail. Learn more... Learn more... | ||
get_client_thumbnail | exec | Returns the PNG thumbnail for this OAuth Client. This is a publicly viewable endpoint, and can be accessed without authentication. | ||
put_client_thumbnail | exec | Upload a thumbnail for a client you own. You must upload a PNG image file that will be returned when the thumbnail is retrieved. This image will be publicly viewable. OAuth scopes.<br /> account:read_write<br /> Learn more... |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
page | integer | The page of a collection to return. |
page_size | integer | The number of items to return per page. |
SELECT
examples
- get_client
- get_clients
Returns information about a single OAuth client.
Learn more...
Learn more...
SELECT
id,
label,
public,
redirect_uri,
secret,
status,
thumbnail_url
FROM linode.account.oauth_clients;
Returns a paginated list of OAuth Clients registered to your Account. OAuth Clients allow users to log into applications you write or host using their Linode Account, and may allow them to grant some level of access to their Linodes or other entities to your application.
Learn more...
Learn more...
SELECT
data,
page,
pages,
results
FROM linode.account.oauth_clients
WHERE page = '{{ page }}'
AND page_size = '{{ page_size }}';
INSERT
examples
- post_client
- Manifest
Creates an OAuth Client, which can be used to allow users (using their Linode account) to log in to your own application, and optionally grant your application some amount of access to their Linodes or other entities.
Learn more...
Learn more...
INSERT INTO linode.account.oauth_clients (
data__label,
data__public,
data__redirect_uri
)
SELECT
'{{ label }}' --required,
{{ public }},
'{{ redirect_uri }}' --required
RETURNING
id,
label,
public,
redirect_uri,
secret,
status,
thumbnail_url
;
# Description fields are for documentation purposes
- name: oauth_clients
props:
- name: label
value: string
description: >
__Filterable__ The name of this application. This will be presented to users when they are asked to grant it access to their Account.
- name: public
value: boolean
description: >
__Filterable__ If this is a public or private OAuth Client. Public clients have a slightly different authentication workflow than private clients. See the [OAuth spec](https://oauth.net/2/) for more details.
default: false
- name: redirect_uri
value: string
description: >
The location a successful log in from [login.linode.com](https://login.linode.com) should be redirected to for this client. The receiver of this redirect should be ready to accept an OAuth exchange code and finish the OAuth exchange.
REPLACE
examples
- put_client
Update information about an OAuth Client on your Account. This can be especially useful to update the redirect_uri
of your client in the event that the callback URL changed in your application.
Learn more...
Learn more...
REPLACE linode.account.oauth_clients
SET
data__label = '{{ label }}',
data__public = {{ public }},
data__redirect_uri = '{{ redirect_uri }}'
WHERE
RETURNING
id,
label,
public,
redirect_uri,
secret,
status,
thumbnail_url;
DELETE
examples
- delete_client
Deletes an OAuth Client registered with Linode. The Client ID and Client secret will no longer be accepted by login.linode.com, and all tokens issued to this client will be invalidated (meaning that if your application was using a token, it will no longer work).
Learn more...
Learn more...
DELETE FROM linode.account.oauth_clients;
Lifecycle Methods
- post_reset_client_secret
- get_client_thumbnail
- put_client_thumbnail
Resets the OAuth Client secret for a client you own, and returns the OAuth Client with the plaintext secret. This secret is not supposed to be publicly known or disclosed anywhere. This can be used to generate a new secret in case the one you have has been leaked, or to get a new secret if you lost the original. The old secret is expired immediately, and logins to your client with the old secret will fail.
Learn more...
Learn more...
EXEC linode.account.oauth_clients.post_reset_client_secret
;
Returns the PNG thumbnail for this OAuth Client. This is a publicly viewable endpoint, and can be accessed without authentication.
EXEC linode.account.oauth_clients.get_client_thumbnail
;
Upload a thumbnail for a client you own. You must upload a PNG image file that will be returned when the thumbnail is retrieved. This image will be publicly viewable. OAuth scopes.
<br /> account:read_write<br />
Learn more...
EXEC linode.account.oauth_clients.put_client_thumbnail
;