Reference
Create o auth code
Approves a desktop app's sign-in for the person in the console: a code, good once for a minute, that only the app's PKCE verifier redeems.
POST
bearerheader
AuthorizationBearer <token>application/json- body
client_id*"skywake-desktop"Value in
"skywake-desktop"redirect_uri*stringMatch
^http:\/\/127\.0\.0\.1:(\d{2,5})\/callback$code_challenge*stringBASE64URL(SHA-256(code_verifier)), without padding.
Match
^[A-Za-z0-9_-]{43}$code_challenge_method*"S256"Value in
"S256"device*stringLength
1 <= length <= 64environment*|The environment the app works in. Null for every one: organization admins only.
Match
^[A-Za-z0-9_-][A-Za-z0-9._-]{0,99}$role*RoleWhat a caller may do. read: files and history. write: also fork, commit and merge. admin: also keys, namespaces, protected branches and the audit log.
Value in
"read""write""admin"The code.
application/json- response
code*stringexpires*stringFormat
date-timecurl -X POST 'https://example.com/v1/oauth/codes' \ -H 'Content-Type: application/json' \ -d '{ "client_id": "skywake-desktop", "redirect_uri": "string", "code_challenge": "string", "code_challenge_method": "S256", "device": "string", "environment": "string", "role": "read"}'Example Response
{ "code": "string", "expires": "2019-08-24T14:15:22Z"}