Skip to main content

Setting up an Okta application for FossID

This describes the one application you create in your own Okta org so your engineers can sign in to FossID tools with their existing Okta accounts.

It takes about ten minutes. You need administrator access to your Okta org. At the end you send us three things; nothing works until you do, and nothing about your org is visible to us before then.

We never ask you for a client secret. If your process wants to issue one, it can be left unused — the application below is a public client and the sign-in flow is protected by PKCE instead. Sending us a secret would mean us holding a credential of yours that we have no way to use.


At a glance​

If you already know Okta, this table is the whole document.

SettingValue
Sign-in methodOIDC — OpenID Connect
Application typeNative Application
Grant typesAuthorization Code and Refresh Token
Client authenticationNone (public client, PKCE)
Sign-in redirect URIsthe six loopback URIs below, exactly, and https://auth.fossid.app/callback
Trusted Originhttps://auth.fossid.app, type CORS
Sign-out redirect URIsnone needed
Allow wildcard * in redirect URIoff
Assignmentswhoever should have FossID access
Scopesopenid, profile, email, offline_access

The two settings that cause almost every failed onboarding are the Refresh Token grant and the redirect URIs. Both are described in full below because both fail quietly rather than loudly.


Step by step​

1. Create the application​

In the Okta Admin Console: Applications and Resources → Applications → Create App Integration.

The first item is easy to scroll past looking for "Applications" on its own — it is the longer "Applications and Resources", with "Applications" nested inside it.

  • Sign-in method: OIDC — OpenID Connect
  • Application type: Native Application

Native Application is the right type even though this is not a phone app. It is the only Okta type that permits the http://127.0.0.1 loopback redirect these tools need: Web Application is a confidential client and expects a secret this flow does not have, and Single-Page Application accepts only https browser origins.

Name it whatever suits your conventions. We do not need to know the name.

2. Turn on both grant types​

Under Grant type, tick:

  • Authorization Code
  • Refresh Token

The Refresh Token grant is the single most common thing to miss, and it fails silently. We request the offline_access scope, which is what asks Okta for a refresh token. If the Refresh Token grant is switched off, Okta does not return an error — it ignores the scope and returns no refresh token. Sign-in appears to work perfectly. Then, roughly once an hour, every one of your engineers is bounced back to an interactive sign-in, with nothing in any log explaining why.

To confirm it took, check that a token response contains a refresh_token field. That is the thing being requested, so its presence is the answer.

Do not test this by looking for offline_access in the response's scope list: OAuth lets a server omit scope when it granted exactly what was asked for, so an absent list proves nothing either way.

3. Register the sign-in redirect URIs​

Add all six, exactly as written:

http://localhost:39820/callback
http://localhost:39821/callback
http://localhost:39822/callback
http://127.0.0.1:39820/callback
http://127.0.0.1:39821/callback
http://127.0.0.1:39822/callback

Three ports, because the tool binds the first one free and a single fixed port would fail for whichever engineer already has something on it. Both spellings, because redirect URIs are compared as exact strings rather than resolved as names — registering only one produces a setup that works for most people and fails for a few.

These are http, not https — which is why step 1 has to be a Native application. The listener is on the engineer's own machine and never accepts a connection from anywhere else.

Then add one more, for the FossID account page, where your administrators manage API keys:

https://auth.fossid.app/callback

This one is https and is not on anyone's own machine; the same application accepts both.

Sign-out redirect URIs: leave empty. Signing out is handled on our side and does not call back into Okta, so there is nothing to register. If that changes we will come to you rather than asking you to add something speculatively now.

4. Let the account page talk to Okta​

The account page finishes a sign-in from the browser, so Okta has to allow requests from it. Under Security → API → Trusted Origins, choose Add Origin and set:

  • Name: FossID
  • Origin URL: https://auth.fossid.app — no path, no trailing slash
  • Type: CORS. Redirect is not needed.

Only the account page needs this. FossID tools on an engineer's machine work without it.

5. Leave the wildcard option off​

Do not enable Allow wildcard * in login URI redirect. It would let any local process receive an authorization code rather than only the three ports we bind, and PKCE makes a stolen code hard to use but does not stop one being delivered to the wrong place.

6. Assign the people who should have access​

Under Assignments, add the users or groups who should be able to sign in to FossID.

This is your control, not ours, and it stays yours. Removing someone here — or deactivating them in your directory — stops them signing in without anyone having to tell us. Access already granted stops working within 15 minutes, which is the lifetime of the tokens we issue.

7. Only if you are giving us a custom authorization server​

Skip this step if your issuer is the plain https://yourcompany.okta.com form.

If you are giving us a custom authorization server — an issuer that looks like https://yourcompany.okta.com/oauth2/<id> — it needs an access policy permitting this application:

Security → API → Authorization Servers, click the server (the one shipped with a new org is named default), then its Access Policies tab, then Add Policy.

If that tab says "No access policies added", this step has not been done, and Okta says why directly underneath: "Policies and rules are required for clients to access this resource."

This is the most likely thing to go wrong, because it is invisible from the outside. A custom authorization server with no access policy looks entirely healthy — it serves its discovery document, publishes a real signing key, and declares the right issuer — and then refuses every token request with access_denied. A new org ships that server with no policies on it at all, so this is the default state rather than an unusual one.

While you are there, confirm the authorization server offers the openid, profile, email and offline_access scopes. The default org authorization server always does; a custom one can be configured without them.


What to send us​

Three things.

1. The issuer. Rather than working out which URL this is, read it off your own org. Open this in a browser, with your org's address in place of the example:

https://yourcompany.okta.com/.well-known/openid-configuration

The value of the issuer field in what comes back is exactly what we need. Copy it as-is.

If you are using a custom authorization server, the console shows it too: Security → API → Authorization Servers lists an Issuer URI against each one.

The one address it never is: your admin console. That is what sits in your address bar while you do everything above, which is what makes it the one most often sent to us by mistake.

https://yourcompany-admin.okta.com the admin console. Not this.
https://yourcompany.okta.com the issuer. This one.

No token your org mints carries the -admin form, so sending it means every sign-in is refused and the refusal cannot say why.

For reference, an issuer always has one of these three shapes — and if you have both an okta.com address and a custom domain, please send the okta.com one:

https://yourcompany.okta.com the org authorization server
https://yourcompany.okta.com/oauth2/<id> a custom authorization server
https://login.yourcompany.com an Okta custom domain

We fetch your signing keys from whatever host the issuer names, so that host becomes part of your sign-in working, and yourcompany.okta.com is a name you cannot accidentally stop renewing. Custom domains are supported — we would just rather it were a deliberate choice than an incidental one.

One thing worth knowing either way: switching a custom domain on later changes the issuer on every token your org mints, and every one of your users is refused at once until we update our record. It is a few minutes to fix and an unpleasant surprise to discover, so it is worth telling us in advance.

2. The client ID of the application you just created. It is on the application's General tab.

If you run a preview or sandbox org alongside production and want both to work, send us the issuer and client ID for each.

3. The email domains your engineers sign in with, such as yourcompany.com. This is what lets someone type their work email and be sent straight to your own Okta rather than a list of providers — and for Okta it is not really optional, since your application lives in your org under your client ID and we have no other way to find it.

List every domain that appears in your engineers' addresses: matching is exact on the whole domain, so yourcompany.com does not cover eng.yourcompany.com. This is routing only and grants nothing by itself — a token still has to verify against your issuer's signing keys and carry your client ID as its audience before anyone gets access.


If the first sign-in does not work​

What you seeAlmost always
access_denied, everything looks configuredMissing access policy on a custom authorization server — step 7
Redirect URI mismatch at the Okta consent pageA typo in one of the six URIs, or only one of localhost / 127.0.0.1 registered
Sign-in works, but users are asked to sign in again about hourlyRefresh Token grant not enabled — step 2
Works for most engineers, fails for oneThat engineer had a port in use, and the URI for the fallback port is missing or misspelled
The user is not assignedStep 6
Okta's 400 page on the account page: the redirect_uri must be a sign-in redirect URIhttps://auth.fossid.app/callback missing from step 3, or added under sign-out instead
The account page says an administrator must add a Trusted OriginStep 4
Every sign-in refused, no useful errorThe issuer we hold is wrong — most often the -admin admin-console address instead of the issuer

A redirect URI typo surfaces on your Okta consent screen, which is the one place in this flow that we cannot see. If a sign-in fails there, the text on that page is the most useful thing you can send us.


What we never do​

  • Ask for or accept a client secret.
  • Ask for credentials for any of your users.
  • Accept an issuer we have not been given by you, or guess one from your domain.
  • Fetch key material from any host other than the issuer you gave us. Removing you as a customer withdraws that permission in the same action.

If you stop using FossID​

Tell us and we remove your record; your issuer stops being reachable from our side immediately and your users stop resolving at the next token issued. You can also simply unassign everyone in step 6, which has the same effect from your users' point of view and needs nothing from us.