Convert user from password to oauth authentication
POST
CoderSessionTokenheader
Coder-Session-Token<token>user*stringUser ID, name, or me
Convert request
application/json- body
password*stringto_type*stringToType is the login type to convert to.
Value in
"""password""github""oidc""token""none"Created
application/json- response
expires_at?stringFormat
date-timestate_string?stringto_type?codersdk.LoginTypeValue in
"""password""github""oidc""token""none"user_id?stringFormat
uuidThe 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"}