Skip to content
Skip to Content
Coder Docs

Convert user from password to oauth authentication

POST
/api/v2/users/{user}/convert-login

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

user*string

User ID, name, or me

Request Body

Convert request

application/json
  1. body
password*string
to_type*string

ToType is the login type to convert to.

Value in"""password""github""oidc""token""none"

Response Body

Created

application/json
  1. response
expires_at?string
Formatdate-time
state_string?string
to_type?codersdk.LoginType
Value in"""password""github""oidc""token""none"
user_id?string
Formatuuid

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X POST \	"$CODER_URL/api/v2/users/{user}/convert-login" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN" \	-H "Content-Type: application/json" \	-d '{  "password": "string",  "to_type": ""}'
Example Response201
{  "expires_at": "2019-08-24T14:15:22Z",  "state_string": "string",  "to_type": "",  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"}