How it works
1
Start the connector consent flow
Redirect the user to
https://aveid.net/connect with the target resource key, the scopes you want, and the communication mode.resource is the resource key of the target Ave-registered resource (not a URL). scope must be one of the scopes defined by the target resource. mode is either user_present or background.2
User approves the grant
The user sees the target resource’s information and what scopes your app is requesting. They choose which identity to use and approve. If they approve, Ave redirects back to your
redirect_uri with a standard ?code=...&state=....3
Exchange the authorization code
Exchange the code exactly like a regular auth code flow to get a source app access token:
4
Exchange for a delegated token
Use the
token-exchange grant to mint a short-lived delegated JWT scoped to the target resource:5
Use the delegated token at the target resource
The response contains a The delegated JWT expires in 10 minutes. Re-exchange when it expires (as long as the grant is still active).
access_token that is a short-lived delegated JWT. Send it to the target resource API as a bearer token:Token exchange request
string
required
Must be exactly
urn:ietf:params:oauth:grant-type:token-exchange.string
required
The
access_token_jwt from the source app’s token response. The server validates this JWT to identify the user and confirm the client ID.string
required
The target resource key (as registered in the developer portal).
string
required
The scope(s) to include in the delegated token. Must be a subset of what was originally granted.
string
required
Your source app’s client ID.
string
required
Your source app’s client secret. This is a server-only call.
Token exchange response
string
A signed delegated JWT. Send this as the bearer token to the target resource.
string
Always
Bearer.number
Token lifetime in seconds. Delegated tokens have a fixed 10-minute TTL.
string
The actual scopes included in the delegated token.
string
The audience of the target resource. The target resource should validate this.
string
The target resource key.
string
Either
user_present or background, as set when the grant was created.Delegated JWT payload
Theaccess_token from the exchange is a JWT with the following claims:
- Signature against Ave’s JWKS
audmatches its registered audienceissishttps://aveid.netexp > nowscopecontains the required scope for the actioncidis a known/trusted source app (optional but recommended)
Server-side enforcement
Ave enforces these rules on every token exchange:subjectTokenmust decode to a valid JWT belonging to the sameclientId- The target resource must exist and be active
- The delegation grant must exist and not be revoked
requestedScopemust be a subset of the granted scoperequestedScopemust be a known scope of the target resource
Grant management
Users can revoke grants. Your app should handleaccess_denied errors gracefully:
GET /api/oauth/delegations— list active grants (requires Ave session auth)DELETE /api/oauth/delegations/:delegationId— revoke a grant
