Skip to content

Add OAuth2 provider configs for Ory, Okta, Discord, Twitch and Spotify - #760

Open
jnbdz wants to merge 7 commits into
eclipse-vertx:masterfrom
SiteNetSoft:issue-377-419-provider-configs
Open

Add OAuth2 provider configs for Ory, Okta, Discord, Twitch and Spotify#760
jnbdz wants to merge 7 commits into
eclipse-vertx:masterfrom
SiteNetSoft:issue-377-419-provider-configs

Conversation

@jnbdz

@jnbdz jnbdz commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #377
Refs #419

Adds five provider shortcuts to vertx-auth-oauth2, one commit per provider so any of them can be dropped independently:

Provider Class Notes
Ory (Ory Network / self hosted Hydra) OryAuth create(vertx, site, clientId, clientSecret) + discover(...); closes #377
Okta OktaAuth org authorization server (create(vertx, clientId, clientSecret, domain)) and custom authorization server (..., domain, authorizationServerId) + discover(...)
Discord DiscordAuth plain OAuth2
Twitch TwitchAuth OIDC, + discover(...); Twitch only accepts client credentials in the token request body so useBasicAuthorization is disabled
Spotify SpotifyAuth plain OAuth2, HTTP basic client auth as required by Spotify

Per the acceptance criteria in #419, every endpoint carries a code comment / javadoc link to the official provider documentation it was taken from, and each javadoc documents the userInfo endpoint and the fields/claims it returns (and which scopes gate them).

ProviderConfigTest verifies, without network access, that each shortcut produces the documented OAuth2Options. On top of that, OpenIDCDiscoveryTest gained live discovery-contract tests (next to the existing Google/Microsoft/Salesforce/IBM/Apple ones) asserting that the endpoints advertised by the Twitch and Okta (org + custom authorization server) discovery documents match what create() hardcodes, so endpoint drift is caught by CI. Ory Network blocks non-browser clients and Discord/Spotify publish no discovery document, so those stay covered by ProviderConfigTest only. The docs list the new providers and add the OIDC discovery URLs for Okta, Ory and Twitch.

Left out of this PR from the #419 list: Apple, Auth0 and GitLab already exist; IdentityServer4 is discontinued; Atlassian, Battle.net and Yandex can follow in a later PR if wanted.

jnbdz added 7 commits August 15, 2026 19:15
Simplified factory for Ory Network / self hosted Ory Hydra with the public
OAuth2/OIDC endpoints documented in the Ory Hydra API reference, plus an
OpenID Connect discovery shortcut.

Fixes eclipse-vertx#377
Supports both the org authorization server and custom authorization servers
(e.g. "default"), with endpoints from the Okta OIDC API reference.

See eclipse-vertx#419
Twitch expects the client credentials in the token request body, so basic
authorization is disabled for this provider.

See eclipse-vertx#419
ProviderConfigTest asserts, without network access, that each new provider
shortcut configures the endpoints documented by the provider. The docs list
the new providers and the OIDC discovery URLs for Okta, Ory and Twitch.
Add discovery-contract tests to OpenIDCDiscoveryTest, next to the existing
live tests for Google, Microsoft, Salesforce, IBM and Apple: the endpoints
advertised in the provider's OpenID Connect discovery document must match
the endpoints hardcoded by TwitchAuth.create() and OktaAuth.create()
(org and custom authorization server variants), so future endpoint drift
is caught by CI.

Endpoints omitted from the discovery document (Twitch does not advertise
its documented revocation endpoint) are not compared. Ory Network is not
reachable from non-browser clients and Discord/Spotify publish no discovery
document, so those providers stay covered by ProviderConfigTest only.
@tsegismont tsegismont added this to the 5.2.0 milestone Aug 24, 2026
@tsegismont

Copy link
Copy Markdown
Member

Thanks @jnbdz for the PR and @pmlopes for reviewing

@tsegismont

Copy link
Copy Markdown
Member

Can you please take a look at the failures?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add auth config for https://www.ory.sh/

3 participants