post-management-instances-INSTANCE-auth.rst (2288B)
1 .. http:post:: /management/instances/$INSTANCE/auth 2 .. http:post:: [/instances/$INSTANCE]/private/auth 3 4 Update the authentication settings for an instance. POST operations against 5 an instance are authenticated by checking that an authorization is provided 6 that matches either the credential required by the instance being modified 7 OR the ``admin`` instance, depending on the access path used. 8 9 **Required permission:** ``instances-auth-write`` 10 11 **Request** the request must be an `InstanceAuthConfigurationMessage`. 12 13 **Response:** 14 15 :http:statuscode:`202 Accepted`: 16 2FA is required for this operation. This returns the `ChallengeResponse` response. @since **v21** 17 :http:statuscode:`204 No content`: 18 The backend has successfully changed the credentials for the instance. 19 :http:statuscode:`404 Not found`: 20 This instance is unknown and thus cannot be reconfigured. 21 22 **Details:** 23 24 .. ts:def:: InstanceAuthConfigurationMessage 25 26 type InstanceAuthConfigurationMessage = InstanceAuthConfigToken | InstanceAuthConfigTokenOLD | InstanceAuthConfigExternal 27 28 .. ts:def:: InstanceAuthConfigToken 29 30 // @since **v19** 31 interface InstanceAuthConfigToken { 32 // The API is accessible through API tokens. 33 // Tokens are retrieved from the /private/token 34 // endpoint. 35 method: "token"; 36 37 // Authentication against the /private/token endpoint 38 // is done using basic authentication with the configured password 39 // in the "password" field. Tokens are passed to other endpoints for 40 // authorization using RFC 8959 bearer tokens. 41 password: string; 42 43 } 44 45 .. ts:def:: InstanceAuthConfigTokenOLD 46 47 // @deprecated since **v19** 48 interface InstanceAuthConfigTokenOLD { 49 // The API is accessible through API tokens. 50 // Tokens are retrieved from the /private/token 51 // endpoint. 52 method: "token"; 53 54 // The value of this field MUST begin with the string "secret-token:". 55 token: string; 56 57 } 58 59 .. ts:def:: InstanceAuthConfigExternal 60 61 // @deprecated since **v20** 62 interface InstanceAuthConfigExternal { 63 // The mechant backend does not do 64 // any authentication checks. Instead an API 65 // gateway must do the authentication. 66 method: "external"; 67 }