If your capsule uses OAuth authorization and you need multiple client IDs for different endpoints, you can now specify multiple OAuth credentials within the new global
key:
authorization {
global {
oauth2-client-credentials (__PROVIDER_ID__) {
client-id (__APP_PUBLIC_ID__)
client-secret-key (__KEY_TO_ACCESS_CLIENT_SECRET__)
scope (__LIST_OF_SCOPES__)
token-endpoint (__ACCESS_TOKEN_ENDPOINT__)
}
oauth2-client-credentials (__PROVIDER_ID_2__) {
client-id (__APP_PUBLIC_ID__)
client-secret-key (__KEY_TO_ACCESS_CLIENT_SECRET__)
scope (__LIST_OF_SCOPES__)
token-endpoint (__ACCESS_TOKEN_ENDPOINT__)
}
}
}
To specify the correct OAuth spec, you must also update the endpoint.bxb
file:
endpoints {
action-endpoints {
action-endpoint (__ACTION_NAME__) {
accepted-inputs (__LIST_OF_ACTION_INPUTS__)
local-endpoint (__JS_FILE_NAME_FUNCTION_REFERENCE__)
authorization (User)
authorization {
user (ProviderId) // value is optional
// ---OR---
global (ProvidierId) // optional value unless >1 globals exist
}
// -- OR --
authorization: user (ProviderId) // optional value
// -- OR --
authorization: global (ProviderId) // optional value unless >1 globals exist
}
}
OAuth provider IDs must be unique.
Deprecation Stages (learn more)