Integrate Login with WorkPair (OIDC and PAR)
Use the authorization code flow with PKCE and pushed authorization requests to receive a signed identity proof.
- Who it’s for
- Developers adding Login with WorkPair to an app.
- What you need first
- A client_id and client_secret (see Add Login with WorkPair)
- Time needed
- 30 minutes
How it works
- Your app’s server pushes the sign-in request to WorkPair (PAR) and gets a request URI. Proof requests never travel in the browser address.
- Your app sends the person’s browser to WorkPair with that request URI.
- The person signs in and consents to exactly what is shared.
- WorkPair sends the browser back to your app with a one-time code.
- Your server exchanges the code for an ID token and, if asked, a signed proof and its hash.
- Anyone holding the hash can check the proof’s status at workpair.io/verify.
Steps
Read the discovery document at
/.well-known/openid-configuration.From your server, push the request to
/oidc/par(client authentication, PKCE S256,scope=openid wp_proof, and awp_proof_requestnaming what you need). You get arequest_uri.Optional scopes:
email(the person’s verified sign-in email,email+email_verified) andwp_id(their public 13-character WorkPair ID,wp_id). Each is released only if the person ticks it;substays pairwise.To learn the person’s organization, add
organization: {roles, org_id, require_verified}towp_proof_request(roles from owner, admin, member;org_idlimits it to one organization). The person picks one; the proof’scredentialSubject.organizationand the ID token’swp_orgcarryid,legal_name,domain,role,verified,verified_at,status(active, suspended, closed),verification(verified, pending, needs_reverification, unverified),profile(country,region,sector,legal_form,size, andwebsiteonly for a verified domain) andupdated_at. Show them read-only: the organization edits them on WorkPair. With no qualifying organization you geterror=access_denied&error_description=no_matching_organization.To keep an organization current, call
GET /v1/oidc/organizations/{orgId}(discovery:wp_organization_endpoint) with your client credentials (client_secret_basic). You get the same object withoutrole, as it stands now, while your client holds a live proof naming that organization; otherwise404.Send the person’s browser to
/oidc/authorize?client_id=…&request_uri=…. They consent on WorkPair.Exchange the
codeat/oidc/tokenwith yourcode_verifier. You receive the ID token, the signed proof andwp_proof_hash.Verify tokens against
/.well-known/jwks.json. The developer guide lists every claim and the proof format.
What happens next
- Check a proof’s status at any time (see Check a proof’s status by API).
- Subscribe to
organization.membership_revoked(someone left, was removed or changed role),organization.status_changed({orgId, verified, status, verification}: verification changed, includingneeds_reverification; suspension; closure) andorganization.profile_changed({orgId, changed, updated_at}: then fetch the organization again) to keep what you show current. - Your workspace wallet pays for sign-ins; keep it funded (auto-recharge in Wallet). If it can’t pay, people see that your application can’t accept WorkPair sign-ins right now.
- Proofs can disclose the legal name and whether and when the identity was verified, plus credentials. They never include a date of birth: date-of-birth or other attribute checks are refused.
Common problems and fixes
invalid_grant.- Codes are single-use and short-lived, and the
code_verifiermust match the challenge.
Still stuck? Write to support@workpair.io and say which guide and step you were on. WorkPair will never ask for your passphrase, a code or an API key.