The flow at a glance
#1. Your app creates state and a PKCE code verifier, stores them in the user's session, and redirects to /oauth/authorize. 2. OzVault signs the user in if needed (new users receive the standard free 15 GB account). 3. The user sees your logo, name, publisher, website, the requested permissions and where they will be returned. 4. On Authorize, OzVault redirects to your redirect_uri with code, state and iss. 5. Your server exchanges the code within two minutes. 6. Your server calls the API with the access token.
No application receives anything merely by redirecting a user: nothing is issued until the user chooses Authorize, and codes are useless without your PKCE verifier.
Build the authorization request
#Every parameter except nonce and prompt is required. state must be 1-1024 printable ASCII characters; generate it randomly per request. code_challenge_method must be S256. Repeating a parameter is an error.
| Parameter | Value |
|---|---|
| response_type | code |
| client_id | Your client ID |
| redirect_uri | One of your registered redirect URLs, exactly |
| scope | Space-separated scopes enabled for your application |
| state | Random value you verify on return (CSRF protection) |
| code_challenge | BASE64URL(SHA-256(code_verifier)), 43 characters |
| code_challenge_method | S256 (plain is not accepted) |
| nonce | Optional; echoed in the id_token when openid is requested |
| prompt | Optional: none, login, consent, or login consent |
GET https://ozvault.lol/oauth/authorize
?response_type=code
&client_id=ovc_YOUR_CLIENT_ID
&redirect_uri=https%3A%2F%2Fexample.com%2Fauth%2Fozvault%2Fcallback
&scope=profile%3Aread%20storage%3Aapp%3Aread%20storage%3Aapp%3Awrite%20offline_access
&state=Wm9wcVZ0Yk1yQ2hLZ0Rz
&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
&code_challenge_method=S256Handle the callback
#On success the user arrives at your redirect URL with code, state and iss (RFC 9207). Compare state with the value you stored for this browser session, and check that iss equals the OzVault issuer, before exchanging the code. If the user cancels or the request is invalid, you receive error and error_description instead; nothing was shared.
https://example.com/auth/ozvault/callback?code=Qe3...&state=Wm9wcVZ0Yk1yQ2hLZ0Rz&iss=https%3A%2F%2Fozvault.lolhttps://example.com/auth/ozvault/callback?error=access_denied&error_description=The+user+declined+to+authorize+this+application&state=Wm9wcVZ0Yk1yQ2hLZ0Rz&iss=https%3A%2F%2Fozvault.lolReturning users and prompt
#If the user already granted every requested scope to your app, OzVault skips the screen and redirects immediately with a new code. Requesting a new scope shows the screen again with the new permission marked. prompt=consent always shows the screen; prompt=login requires a fresh sign-in; prompt=none never shows UI and returns login_required or consent_required when interaction would be needed.
Authorization errors
#Errors about the client or redirect URL are shown on OzVault and never redirected, so a forged link cannot bounce users to an attacker. Other problems are returned to your registered redirect URL.
| error | Meaning |
|---|---|
| access_denied | The user chose Cancel |
| invalid_request | Missing or repeated parameter, missing state, or PKCE not S256 |
| invalid_scope | Unknown scope, or one not enabled for your application |
| unsupported_response_type | response_type was not code |
| login_required / consent_required | prompt=none could not complete without the user |
Clear documentation is part of the product.