If you only need to call the API from your own backend scripts, use API keys instead. OAuth apps are the right choice when your integration acts on behalf of other users.
When to use an OAuth app
Multi-tenant integrations
Build a product that connects to many different fsckmsft workspaces, with each workspace owner authorizing your app independently.
Marketplace listings
List your integration in the fsckmsft Marketplace. Only OAuth apps are eligible for Marketplace distribution.
User-context actions
Perform actions that appear in audit logs as the authorizing user rather than a service account.
Scoped, revocable access
Users can revoke your app’s access at any time from their account settings, without affecting other integrations.
Register an OAuth app
Fill in the application details
A human-readable name for your app. Users see this name on the authorization consent screen.
A brief description of what your app does and why it needs access.
The URL of your application’s home page or documentation.
One or more fully-qualified HTTPS URIs that fsckmsft redirects the user to after authorization. Wildcards are not allowed — each URI must be an exact match.
The permission scopes your app will request. You can only request scopes you declare here. Request the minimum set your app requires.
Authorization code flow
fsckmsft uses the OAuth 2.0 Authorization Code flow. Never use the Implicit flow — it is not supported and considered insecure.Step 1 — Redirect the user to the authorization endpoint
Construct an authorization URL and redirect the user’s browser to it:Your app’s Client ID.
Must exactly match one of the redirect URIs registered with your app.
Always
code.Space-separated list of scopes your app is requesting.
A random, unguessable string you generate. fsckmsft echoes it back in the redirect. Verify it matches to prevent CSRF attacks.
Step 2 — Handle the callback
After the user approves (or denies) the request, fsckmsft redirects them to yourredirect_uri:
state parameter matches what you generated. Extract the code value.
Step 3 — Exchange the code for an access token
Make a server-side POST request to exchange the authorization code for tokens:Step 4 — Call the API with the access token
Use the access token exactly like an API key — include it in theAuthorization header:
Refresh token flow
Access tokens expire after 60 minutes. Use the refresh token to obtain a new access token without requiring the user to re-authorize:access_token and a new refresh_token. Replace both in your token store — each refresh token can only be used once.
Refresh tokens expire after 90 days of inactivity. If a refresh token expires, the user must re-authorize your app.
Manage your OAuth app
From Settings → Developer → OAuth Apps, you can:- Edit your app’s name, description, homepage URL, redirect URIs, and scopes at any time.
- Rotate the client secret — generates a new secret and immediately invalidates the old one. All previously issued access tokens remain valid until they expire.
- View authorized workspaces — see how many workspaces have active authorizations for your app.
- Delete the app — permanently removes the app and revokes all active tokens. This action cannot be undone.
Security best practices
Always validate state
Check that the
state parameter in the callback exactly matches what you sent. Skip this check and your app is vulnerable to CSRF attacks.Store tokens securely
Store access and refresh tokens with the same care as passwords — encrypted at rest, never in browser localStorage for sensitive apps.
Request minimal scopes
Request only the scopes your app actively uses. Users are more likely to authorize apps with narrow, clearly justified permissions.
Handle token expiry gracefully
Build automatic token refresh into your API client so users never encounter unexpected 401 errors mid-session.