Skip to main content
A REST API connection stores how Prophecy obtains an access token for an API. When the RestAPI gem uses the Connection authentication type, Prophecy gets a bearer token from the selected connection and sends it with each request. REST API connections support two authentication methods: interactive OAuth, where a person signs in through a browser, and OIDC, where Prophecy authenticates as a service principal. Use OIDC for scheduled and deployed pipelines, because it doesn’t require anyone to sign in.

Connection parameters

To create a REST API connection, enter the following parameters:

Authentication methods

OAuth

OAuth uses the interactive authorization code flow. A person signs in to the identity provider in a browser, and Prophecy stores the resulting token for that person. After you configure the connection, click OAuth Login to authorize it.

OIDC

OIDC uses the OAuth 2.0 client credentials flow. Prophecy requests a token from your identity provider as a service principal, with no browser sign-in. Prophecy caches the token and requests a new one shortly before it expires. When you test an OIDC connection, Prophecy requests a fresh token to confirm that the credentials work.

Client authentication

The fields that the connection requires depend on the Client Authentication method: Store the certificate, private key, and client secret as secrets. The certificate must be a PEM X.509 certificate registered with the identity provider, and the private key must be an unencrypted PEM RSA private key.