SSO Setup: Microsoft Entra ID¶
Use this guide to let people sign in to JIM with their Microsoft Entra ID accounts, both in the portal and in the PowerShell module with Connect-JIM. One command registers JIM in your tenant, and you give JIM the values it returns. JIM identifies each person by their Entra ID object ID (the oid claim), which is the same whichever way they sign in and stays the same for the life of their account. This configuration is verified against Microsoft Entra ID before every JIM release.
Read the overview first
This page is one of the provider-specific guides linked from the SSO Setup overview. The overview covers the confidential and public client model these steps rely on, how JIM recognises people, and the testing steps you can run once configuration is complete.
Before you begin¶
You need:
- An account that registers applications and gives admin consent in your tenant, such as an Application Administrator or Cloud Application Administrator.
- JIM's address, such as
https://jim.example.com, with the port if JIM does not use 443. - PowerShell 7 with the JIM PowerShell module, on any computer that can reach
login.microsoftonline.comandgraph.microsoft.com. See Installation. - JIM able to reach
login.microsoftonline.com. Entra ID is a cloud service, so this is the one part of JIM's sign-in that needs the internet. - The people who will sign in, in the Metaverse with their object ID. JIM signs someone in only when it has a Metaverse Object whose
Object Identifierholds their Entra ID object ID: map it from a Connected System that holds it (see Attribute Mappings). Your first administrator is the exception: JIM creates them at their first sign-in.
Step 1: Register JIM with Entra ID¶
Register-JIMIdentityProvider creates JIM's application in your tenant and returns the values JIM needs, your own object ID among them. What the application contains is on the cmdlet's page: Register-JIMIdentityProvider.
-
In PowerShell 7, run the command with JIM's address and your tenant:
$registration = Register-JIMIdentityProvider -Provider EntraId -Url 'https://jim.example.com' -TenantId 'contoso.onmicrosoft.com' $registration | Select-Object Authority, ClientId, ApiScope, ClaimType, MvAttribute, InitialAdminIt shows a code and a web address. Open the address, enter the code, and sign in with the account from Before you begin. Add
-WhatIffirst if you want to see each change the command would make; it makes none. -
Copy the portal's client secret. Entra ID shows it only once, so keep it safe until Step 2:
If the secret is lost, run the command again with
-ResetClientSecretfor a new one. The command removes the old secret, so JIM signs nobody in untilJIM_SSO_SECRETholds the new one.
InitialAdmin is the object ID of the account you signed in with. If someone else is to be JIM's first administrator, use their object ID instead: it is on their page in the Microsoft Entra admin centre, under Users.
Step 2: Configure JIM¶
Set these environment variables to the values from Step 1, then restart JIM (see Configuration Reference):
JIM_SSO_AUTHORITY={Authority}
JIM_SSO_CLIENT_ID={ClientId}
JIM_SSO_SECRET={the client secret from Step 1}
JIM_SSO_API_SCOPE={ApiScope}
# Identify people by their Entra ID object ID ({ClaimType} and {MvAttribute})
JIM_SSO_CLAIM_TYPE=oid
JIM_SSO_MV_ATTRIBUTE=Object Identifier
JIM_SSO_INITIAL_ADMIN={InitialAdmin}
Example:
JIM_SSO_AUTHORITY=https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0
JIM_SSO_CLIENT_ID=e1234567-89ab-cdef-0123-456789abcdef
JIM_SSO_SECRET=generatedSecretValue123
JIM_SSO_API_SCOPE=api://e1234567-89ab-cdef-0123-456789abcdef/access_as_user
JIM_SSO_CLAIM_TYPE=oid
JIM_SSO_MV_ATTRIBUTE=Object Identifier
JIM_SSO_INITIAL_ADMIN=3f2504e0-4f89-11d3-9a0c-0305e82c3301
JIM_SSO_PUBLIC_CLIENT_ID stays unset: the PowerShell module signs in with the same application. Scripts that run unattended cannot sign in interactively, so they use a JIM API key instead; see API Authentication.
Check it worked¶
- Open JIM in a browser as your first administrator. JIM sends you to Microsoft Entra ID to sign in, then returns you to JIM, signed in.
- Open
/claimsand check thatoid,nameandemailcarry your values. - In PowerShell 7, run
Connect-JIM -Url 'https://jim.example.com', sign in in the browser it opens, then runGet-JIMUserInfo. It reportsIsAdministrator : True, with theAdministratorandUserroles. - Open the API reference at
https://jim.example.com/api/referenceand sign in from Try It. It needs nothing more: the command registered the page. - Sign in as someone with no JIM role. JIM signs them in and refuses them administration.
To check sign-out too, see Testing Your Configuration.
Keep the registration right¶
Run the command again whenever you like, with the same -Url values. It changes nothing when the registration is right, and puts back anything that has drifted, such as a redirect URI someone removed. Give every address people reach JIM at to -Url; one left out has its redirect URIs removed.
The command signs you in each time. To run it unattended, give it a Microsoft Graph token with -AccessToken, for example from a workload identity. A token holding only Application.ReadWrite.OwnedBy keeps a registration its application owns right, but cannot give consent, and the command warns that an administrator must.
Registering by hand¶
If you cannot run the command, register the application in the Microsoft Entra admin centre under App registrations, so that it matches what the command makes:
| Where | Setting |
|---|---|
| Overview | Supported account types: this organisational directory only |
| Authentication | Web redirect URIs https://jim.example.com/signin-oidc and https://jim.example.com/signout-callback-oidc; Mobile and desktop applications redirect URIs http://localhost:8400/callback/ to http://localhost:8409/callback/; Single-page application redirect URI https://jim.example.com/api/reference/ |
| Certificates & secrets | A client secret, for JIM_SSO_SECRET |
| Expose an API | Application ID URI api://{client ID}, and a scope access_as_user that admins and users can consent to |
| Manifest | "requestedAccessTokenVersion": 2 |
| Token configuration | The optional claim email, in ID and access tokens |
| API permissions | Microsoft Graph delegated openid, profile, email and offline_access, then Grant admin consent |
The values for Step 2 are then: https://login.microsoftonline.com/{tenant ID}/v2.0 for JIM_SSO_AUTHORITY, the application's client ID for JIM_SSO_CLIENT_ID, and api://{client ID}/access_as_user for JIM_SSO_API_SCOPE. Your object ID is on your page under Users.
Microsoft Entra ID Troubleshooting¶
Get-JIMSignInDiagnosticnamesrequestedAccessTokenVersion: Entra ID is issuing version 1 access tokens, whose audience JIM does not accept. SetrequestedAccessTokenVersionto2in the application's manifest, or runRegister-JIMIdentityProvideragain, which does.- People are asked to consent, or refused with
AADSTS65001: nobody has consented to JIM's permissions for everyone. RunRegister-JIMIdentityProvideragain as an account that may give admin consent, or select Grant admin consent on the application's API permissions page. - Sign-in is unavailable / JIM does not trust the certificate: Microsoft Entra ID's certificates come from public certificate authorities the operating system trusts, so this usually means a proxy between JIM and Microsoft inspects TLS and presents your organisation's certificate instead. Trust the proxy's certificate authority for sign-in; see Trust Your Identity Provider's Certificate.
Next steps¶
If sign-out fails, see Sign-Out Troubleshooting.