Logins API
API for creating and viewing user logins under an account
List user logins PseudonymsController#index
GET /api/v1/accounts/:account_id/logins
url:GET|/api/v1/accounts/:account_id/logins
GET /api/v1/users/:user_id/logins
url:GET|/api/v1/users/:user_id/logins
Given a user ID, return a paginated list of that user's logins for the given account.
API response field:
-
account_id
The ID of the login's account.
-
id
The unique, numeric ID for the login.
-
sis_user_id
The login's unique SIS ID.
-
integration_id
The login's unique integration ID.
-
unique_id
The unique ID for the login.
-
user_id
The unique ID of the login's user.
-
authentication_provider_id
The ID of the authentication provider that this login is associated with
-
authentication_provider_type
The type of the authentication provider that this login is associated with
Example Response:
[
{
"account_id": 1,
"id" 2,
"sis_user_id": null,
"unique_id": "belieber@example.com",
"user_id": 2,
"authentication_provider_id": 1,
"authentication_provider_type": "facebook"
}
]
Create a user login PseudonymsController#create
POST /api/v1/accounts/:account_id/logins
url:POST|/api/v1/accounts/:account_id/logins
Create a new login for an existing user in the given account.
Request Parameters:
Parameter | Type | Description | |
---|---|---|---|
user[id] | Required | string |
The ID of the user to create the login for. |
login[unique_id] | Required | string |
The unique ID for the new login. |
login[password] | string |
The new login's password. |
|
login[sis_user_id] | string |
SIS ID for the login. To set this parameter, the caller must be able to manage SIS permissions on the account. |
|
login[integration_id] | string |
Integration ID for the login. To set this parameter, the caller must be able to manage SIS permissions on the account. The Integration ID is a secondary identifier useful for more complex SIS integrations. |
|
login[authentication_provider_id] | string |
The authentication provider this login is associated with. Logins associated with a specific provider can only be used with that provider. Legacy providers (LDAP, CAS, SAML) will search for logins associated with them, or unassociated logins. New providers will only search for logins explicitly associated with them. This can be the integer ID of the provider, or the type of the provider (in which case, it will find the first matching provider). |
Example Request:
#create a facebook login for user with ID 123
curl 'https://<canvas>/api/v1/accounts/<account_id>/logins' \
-F 'user[id]=123' \
-F 'login[unique_id]=112233445566' \
-F 'login[authentication_provider_id]=facebook' \
-H 'Authorization: Bearer <token>'
Edit a user login PseudonymsController#update
PUT /api/v1/accounts/:account_id/logins/:id
url:PUT|/api/v1/accounts/:account_id/logins/:id
Update an existing login for a user in the given account.
Request Parameters:
Parameter | Type | Description | |
---|---|---|---|
login[unique_id] | string |
The new unique ID for the login. |
|
login[password] | string |
The new password for the login. Can only be set by an admin user if admins are allowed to change passwords for the account. |
|
login[sis_user_id] | string |
SIS ID for the login. To set this parameter, the caller must be able to manage SIS permissions on the account. |
|
login[integration_id] | string |
Integration ID for the login. To set this parameter, the caller must be able to manage SIS permissions on the account. The Integration ID is a secondary identifier useful for more complex SIS integrations. |
Delete a user login PseudonymsController#destroy
DELETE /api/v1/users/:user_id/logins/:id
url:DELETE|/api/v1/users/:user_id/logins/:id
Delete an existing login.
Example Request:
curl https://<canvas>/api/v1/users/:user_id/logins/:login_id \
-H "Authorization: Bearer <ACCESS-TOKEN>" \
-X DELETE
Example Response:
{
"unique_id": "bieber@example.com",
"sis_user_id": null,
"account_id": 1,
"id": 12345,
"user_id": 2
}