Update OAuth2 Client
PUT
/appid-{appId}/recipe/oauth/clientsAuthorization
api-keyAPI key · headerrequiredThe core service API token. If you are using a self-hosted core service and you have not generated a token, you can omit the header.
Header parameters
cdi-versionstringX.Y of the X.Y.Z CDI version.
Request body
application/jsonclientIdstringclientNamestringclientSecretstringredirectUrisstring[]grantTypesstring[]responseTypesstring[]scopestringaudiencestring[]policyUristringallowedCorsOriginsstring[]tosUristringclientUristringlogoUristringtokenEndpointAuthMethodstringcreatedAtstring<date-time>updatedAtstring<date-time>postLogoutRedirectUrisstring[]metadataobjectauthorizationCodeGrantAccessTokenLifespanstring | nullauthorizationCodeGrantIdTokenLifespanstring | nullauthorizationCodeGrantRefreshTokenLifespanstring | nullclientCredentialsGrantAccessTokenLifespanstring | nullimplicitGrantAccessTokenLifespanstring | nullimplicitGrantIdTokenLifespanstring | nullrefreshTokenGrantIdTokenLifespanstring | nullrefreshTokenGrantAccessTokenLifespanstring | nullrefreshTokenGrantRefreshTokenLifespanstring | nullenableRefreshTokenRotationbooleanResponses
200OAuth2 Client Result
One of:
object
statusstatusOKAllowed:
OKclientIdstringclientNamestringclientSecretstringredirectUrisstring[]grantTypesstring[]responseTypesstring[]scopestringaudiencestring[]policyUristringallowedCorsOriginsstring[]tosUristringclientUristringlogoUristringtokenEndpointAuthMethodstringcreatedAtstring<date-time>updatedAtstring<date-time>postLogoutRedirectUrisstring[]metadataobjectauthorizationCodeGrantAccessTokenLifespanstring | nullauthorizationCodeGrantIdTokenLifespanstring | nullauthorizationCodeGrantRefreshTokenLifespanstring | nullclientCredentialsGrantAccessTokenLifespanstring | nullimplicitGrantAccessTokenLifespanstring | nullimplicitGrantIdTokenLifespanstring | nullrefreshTokenGrantIdTokenLifespanstring | nullrefreshTokenGrantAccessTokenLifespanstring | nullrefreshTokenGrantRefreshTokenLifespanstring | nullenableRefreshTokenRotationbooleanoauthError
statusstringrequiredAllowed:
OAUTH_ERRORerrorstringrequirederrorDescriptionstringrequiredstatusCodeintegerrequired400error code 400
string401error code 401
string402error code 402
string404error code 404
string500error code 500
stringTry it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PUT "/appid-{appId}/recipe/oauth/clients" \
-H "api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"clientId": "stcl_c6dd9189-33b8-4ec0-8aea-a0ffdaf75fcb",
"clientName": "Hello",
"clientSecret": "T98n1YIMWqr4wOM.~bV4HOPFmO",
"redirectUris": [
"http://localhost:3000/auth/callback/ory"
],
"grantTypes": [
"authorization_code",
"refresh_token"
],
"responseTypes": [
"code",
"id_token"
],
"scope": "offline_access openid email",
"audience": [],
"policyUri": "",
"allowedCorsOrigins": [],
"tosUri": "",
"clientUri": "",
"logoUri": "",
"tokenEndpointAuthMethod": "client_secret_post",
"createdAt": "2025-02-24T08:14:40Z",
"updatedAt": "2025-02-24T08:14:40.362463Z",
"postLogoutRedirectUris": [
"http://localhost:3000"
],
"metadata": {},
"authorizationCodeGrantAccessTokenLifespan": "1h0m0s",
"authorizationCodeGrantIdTokenLifespan": "1h0m0s",
"authorizationCodeGrantRefreshTokenLifespan": "1h0m0s",
"clientCredentialsGrantAccessTokenLifespan": "1h0m0s",
"implicitGrantAccessTokenLifespan": "1h0m0s",
"implicitGrantIdTokenLifespan": "1h0m0s",
"refreshTokenGrantIdTokenLifespan": "1h0m0s",
"refreshTokenGrantAccessTokenLifespan": "1h0m0s",
"refreshTokenGrantRefreshTokenLifespan": "1h0m0s",
"enableRefreshTokenRotation": false
}'const response = await fetch("/appid-{appId}/recipe/oauth/clients", {
method: "PUT",
headers: {
"api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"clientId": "stcl_c6dd9189-33b8-4ec0-8aea-a0ffdaf75fcb",
"clientName": "Hello",
"clientSecret": "T98n1YIMWqr4wOM.~bV4HOPFmO",
"redirectUris": [
"http://localhost:3000/auth/callback/ory"
],
"grantTypes": [
"authorization_code",
"refresh_token"
],
"responseTypes": [
"code",
"id_token"
],
"scope": "offline_access openid email",
"audience": [],
"policyUri": "",
"allowedCorsOrigins": [],
"tosUri": "",
"clientUri": "",
"logoUri": "",
"tokenEndpointAuthMethod": "client_secret_post",
"createdAt": "2025-02-24T08:14:40Z",
"updatedAt": "2025-02-24T08:14:40.362463Z",
"postLogoutRedirectUris": [
"http://localhost:3000"
],
"metadata": {},
"authorizationCodeGrantAccessTokenLifespan": "1h0m0s",
"authorizationCodeGrantIdTokenLifespan": "1h0m0s",
"authorizationCodeGrantRefreshTokenLifespan": "1h0m0s",
"clientCredentialsGrantAccessTokenLifespan": "1h0m0s",
"implicitGrantAccessTokenLifespan": "1h0m0s",
"implicitGrantIdTokenLifespan": "1h0m0s",
"refreshTokenGrantIdTokenLifespan": "1h0m0s",
"refreshTokenGrantAccessTokenLifespan": "1h0m0s",
"refreshTokenGrantRefreshTokenLifespan": "1h0m0s",
"enableRefreshTokenRotation": false
})
});import requests
response = requests.put(
"/appid-{appId}/recipe/oauth/clients",
headers={
"api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"clientId": "stcl_c6dd9189-33b8-4ec0-8aea-a0ffdaf75fcb",
"clientName": "Hello",
"clientSecret": "T98n1YIMWqr4wOM.~bV4HOPFmO",
"redirectUris": [
"http://localhost:3000/auth/callback/ory"
],
"grantTypes": [
"authorization_code",
"refresh_token"
],
"responseTypes": [
"code",
"id_token"
],
"scope": "offline_access openid email",
"audience": [],
"policyUri": "",
"allowedCorsOrigins": [],
"tosUri": "",
"clientUri": "",
"logoUri": "",
"tokenEndpointAuthMethod": "client_secret_post",
"createdAt": "2025-02-24T08:14:40Z",
"updatedAt": "2025-02-24T08:14:40.362463Z",
"postLogoutRedirectUris": [
"http://localhost:3000"
],
"metadata": {},
"authorizationCodeGrantAccessTokenLifespan": "1h0m0s",
"authorizationCodeGrantIdTokenLifespan": "1h0m0s",
"authorizationCodeGrantRefreshTokenLifespan": "1h0m0s",
"clientCredentialsGrantAccessTokenLifespan": "1h0m0s",
"implicitGrantAccessTokenLifespan": "1h0m0s",
"implicitGrantIdTokenLifespan": "1h0m0s",
"refreshTokenGrantIdTokenLifespan": "1h0m0s",
"refreshTokenGrantAccessTokenLifespan": "1h0m0s",
"refreshTokenGrantRefreshTokenLifespan": "1h0m0s",
"enableRefreshTokenRotation": False
},
)Response
{
"status": "OK",
"clientId": "stcl_c6dd9189-33b8-4ec0-8aea-a0ffdaf75fcb",
"clientName": "Hello",
"clientSecret": "T98n1YIMWqr4wOM.~bV4HOPFmO",
"redirectUris": [
"http://localhost:3000/auth/callback/ory"
],
"grantTypes": [
"authorization_code",
"refresh_token"
],
"responseTypes": [
"code",
"id_token"
],
"scope": "offline_access openid email",
"audience": [],
"policyUri": "",
"allowedCorsOrigins": [],
"tosUri": "",
"clientUri": "",
"logoUri": "",
"tokenEndpointAuthMethod": "client_secret_post",
"createdAt": "2025-02-24T08:14:40Z",
"updatedAt": "2025-02-24T08:14:40.362463Z",
"postLogoutRedirectUris": [
"http://localhost:3000"
],
"metadata": {},
"authorizationCodeGrantAccessTokenLifespan": "1h0m0s",
"authorizationCodeGrantIdTokenLifespan": "1h0m0s",
"authorizationCodeGrantRefreshTokenLifespan": "1h0m0s",
"clientCredentialsGrantAccessTokenLifespan": "1h0m0s",
"implicitGrantAccessTokenLifespan": "1h0m0s",
"implicitGrantIdTokenLifespan": "1h0m0s",
"refreshTokenGrantIdTokenLifespan": "1h0m0s",
"refreshTokenGrantAccessTokenLifespan": "1h0m0s",
"refreshTokenGrantRefreshTokenLifespan": "1h0m0s",
"enableRefreshTokenRotation": false
}"string""Invalid API key""License Error""Not Found""Internal Error"