Skip to main content

Azure AD Authentication

PlatformWorks Hub supports login via Azure Active Directory using OAuth2.

When Azure AD is configured, only users authenticated through your tenant can access the application.


Required Environment Variables

VariableDescription
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_IDAzure AD application (client) ID
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRETAzure AD application secret
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_SCOPETypically: openid,profile,email
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_AUTHORIZATION_GRANT_TYPEUsually: authorization_code
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_AUTHORIZATION_URIAzure authorize endpoint
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_TOKEN_URIAzure token endpoint
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_USER_INFO_URIAzure user info endpoint
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URIYour Azure tenant issuer URI
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_JWK_SET_URIURL to the JWK set for token signing

Setup Instructions (Azure Portal)

  1. Go to Azure Active DirectoryApp registrations
  2. Click New registration
    • Name: e.g. Hub App (any friendly name)
    • Supported account types: Choose based on your organization
    • Redirect URI:
      • Type: Web
      • Value: https://your-domain.com/login/oauth2/code/oidc
        (replace your-domain.com with the actual deployment domain)
  3. After creation:
    • Navigate to Certificates & secrets
      • Generate a client secret
      • Save both the Client ID and Client Secret
  4. Go to the Endpoints tab:
    • Copy the following:
      • Authorization URL
      • Token URL
      • Issuer URI
      • JWK Set URL
      • UserInfo URL
  5. Set the frontend logout URL (in your app config):
    https://your-domain.com/logout