Test mode: paid plans aren't on sale yet, so nothing is charged. Every plan's limits apply.

← Docs

Libraries

Nod speaks standard OpenID Connect and OAuth 2.0, so your language's usual library works unchanged. These are the ones tested against a real Nod on every change to the interop run (scripts/interop, see development), at exactly these versions, each used the way its own docs say:

LanguageLibraryVersion testedChecked
Nodeopenid-client, with jose for APIs6.9.0, 6.2.17discovery, code flow with PKCE, RS256 and EdDSA ID tokens, RFC 9207 iss, userinfo, refresh with reuse refused, introspection, revocation, client credentials, PAR, DPoP, access tokens checked by an API
PythonAuthlib1.6.12code flow with PKCE, ID tokens (CodeIDToken, RS256 and EdDSA, at_hash), userinfo, refresh with reuse refused, introspection, revocation, client credentials
Gogo-oidc with golang.org/x/oauth23.14.1, 0.30.0discovery, code flow with PKCE, RS256 and EdDSA ID tokens, RFC 9207 iss, userinfo, refresh, client credentials
Rustopenidconnect4.0.1discovery, code flow with PKCE, RS256 and EdDSA ID tokens, at_hash, RFC 9207 iss, userinfo, refresh, client credentials
JavaNimbus OAuth 2.0 SDK (what Spring Security builds on)11.26discovery, code flow with PKCE, RS256 ID tokens (IDTokenValidator) and at_hash, RFC 9207 iss, userinfo, refresh with reuse refused, client credentials
.NETDuende OidcClient with IdentityModel7.1.1, 8.1.0code flow with PKCE, ID tokens validated by OidcClient, RFC 9207 iss, discovery's issuer check, userinfo, refresh with reuse refused, client credentials with resource, a wrong secret refused

Frameworks built on these (Spring Security on Nimbus, Authlib's Django and Flask integrations) talk to Nod through the same code, though they aren't tested here themselves.

What every library needs

Snippets

Each is cut from the tested driver; the drivers in scripts/interop show the whole flow, refresh and client credentials included. The Node and Python ones are in the quickstart.

Go (go-oidc and x/oauth2):

provider, err := oidc.NewProvider(ctx, "https://auth.example.com/acme")
conf := &oauth2.Config{ClientID: "web", ClientSecret: secret, Endpoint: provider.Endpoint(),
	RedirectURL: "https://app.example.com/cb", Scopes: []string{oidc.ScopeOpenID, "profile", "email"}}
verifier := oauth2.GenerateVerifier()
url := conf.AuthCodeURL(state, oidc.Nonce(nonce), oauth2.S256ChallengeOption(verifier))
// … the callback:
tok, err := conf.Exchange(ctx, code, oauth2.VerifierOption(verifier))
idt, err := provider.Verifier(&oidc.Config{ClientID: "web"}).Verify(ctx, tok.Extra("id_token").(string))
// check idt.Nonce == nonce, and idt.VerifyAccessToken(tok.AccessToken) when at_hash is present

Rust (openidconnect):

let meta = CoreProviderMetadata::discover_async(IssuerUrl::new(issuer)?, &http).await?;
let client = CoreClient::from_provider_metadata(meta, ClientId::new("web".into()), Some(ClientSecret::new(secret)))
    .set_redirect_uri(RedirectUrl::new("https://app.example.com/cb".into())?);
let (challenge, verifier) = PkceCodeChallenge::new_random_sha256();
let (url, state, nonce) = client
    .authorize_url(CoreAuthenticationFlow::AuthorizationCode, CsrfToken::new_random, Nonce::new_random)
    .add_scope(Scope::new("email".into()))
    .set_pkce_challenge(challenge)
    .url();
// … the callback:
let tokens = client.exchange_code(AuthorizationCode::new(code))?.set_pkce_verifier(verifier).request_async(&http).await?;
let claims = tokens.id_token().unwrap().claims(&client.id_token_verifier(), &nonce)?;

Build the HTTP client without following redirects, as the crate's docs advise (against SSRF).

Java (Nimbus):

var op = OIDCProviderMetadata.resolve(new Issuer("https://auth.example.com/acme"));
var request = new AuthenticationRequest.Builder(new ResponseType(ResponseType.Value.CODE),
        new Scope("openid", "profile", "email"), new ClientID("web"), callback)
    .endpointURI(op.getAuthorizationEndpointURI()).state(state).nonce(nonce)
    .codeChallenge(verifier, CodeChallengeMethod.S256).build();
// … the callback:
var ok = AuthorizationResponse.parse(callbackUri).toSuccessResponse();   // check ok.getState() and ok.getIssuer()
var tokenRequest = new TokenRequest.Builder(op.getTokenEndpointURI(),
    new ClientSecretBasic(new ClientID("web"), new Secret(secret)),
    new AuthorizationCodeGrant(ok.getAuthorizationCode(), callback, verifier)).build();
var tokens = ((OIDCTokenResponse) OIDCTokenResponseParser.parse(tokenRequest.toHTTPRequest().send())
    .toSuccessResponse()).getOIDCTokens();
var claims = new IDTokenValidator(op.getIssuer(), new ClientID("web"), JWSAlgorithm.RS256, op.getJWKSetURI().toURL())
    .validate(tokens.getIDToken(), nonce);

Spring Boot apps should get the same (Spring itself isn't in the run; Nimbus, which it uses, is) with spring-boot-starter-oauth2-client and spring.security.oauth2.client.provider.harpora.issuer-uri=https://auth.example.com/acme.

.NET (Duende OidcClient):

var client = new OidcClient(new OidcClientOptions {
    Authority = "https://auth.example.com/acme", ClientId = "web", ClientSecret = secret,
    RedirectUri = "https://app.example.com/cb", Scope = "openid profile email offline_access" });
var state = await client.PrepareLoginAsync();          // PKCE, state and nonce: send the browser to state.StartUrl
// … the callback:
var result = await client.ProcessResponseAsync(callbackUrl, state);   // the ID token validated; result.User
var refreshed = await client.RefreshTokenAsync(result.RefreshToken);  // store refreshed.RefreshToken: it rotated

An API's token, for a service: RequestClientCredentialsTokenAsync with Resource = { "https://api.example.com" }. Nod answers a wrong secret sent with Basic authentication with 401 and invalid_client, as RFC 6749 §5.2 requires; IdentityModel then reports the HTTP error, and the body is in response.Json.

Not here yet

Libraries for PHP, Ruby, Swift and Kotlin aren't in the interop run yet. Any certified OpenID Connect relying-party library should work; if one doesn't, it is a bug in Nod we want to hear about.