Breached password detection is a critical component of secure applications.    Read the white paper

FusionAuth logo
FusionAuth logo
  • Features
    FusionAuth Reactor

    FusionAuth Reactor is a powerful suite of features developed to extend FusionAuth's core functionality.

    • Flexible Architecture   Flexible Architecture
    • Auth the Way You Want It   Auth the Way You Want It
    • Security & Compliance   Security & Compliance
    • Ultimate Password Control   Ultimate Password Control
    • Customizable User Experience   Customizable User Experience
    • Advanced Registration Forms   Advanced Registration Forms
    • Built for Devs   Built for Devs
    • User Management & Reporting   User Management & Reporting
    • Scalability   Scalability
    • Single Sign-on   Single Sign-on
    • Breached Password Detection   Breached Password Detection
    • Connectors   Connectors
    • FusionAuth Reactor   FusionAuth Reactor
  • Pricing
    Cloud Pricing

    Let us host, monitor, manage, and maintain your deployments in your own private cloud.

    SEE PRICING cloud pricing   See FusionAuth Cloud Pricing
    Editions Pricing

    A powerful set of features with available support that extends FusionAuth's core functionality.

    SEE PRICING edition pricing   See FusionAuth Edition Pricing
    Editions + Cloud

    FusionAuth will handle everything so you can get back to building something awesome.

    GET STARTED Get started
  • Docs
  • Downloads
  • Resources
    FusionAuth Resources
    • Upgrade from SaaS
    • Upgrade from Open Source
    • Upgrade from Home Grown
    • Blog   Blog
    • Forum   Forum
    • Community & Support   Community & Support
    • Customer & Partners   Customers & Partners
    • Video & Podcasts   Videos & Podcasts
    • Getting Started   Getting Started
  • Expert Advice
    Expert Advice for Developers

    Learn everything you need to know about authentication, authorization, identity, and access management from our team of industry experts.

    • Authentication   Authentication
    • CIAM   CIAM
    • Identity Basics   Identity Basics
    • OAuth   OAuth
    • Security   Security
    • Tokens   Tokens
    • Dev Tools   Dev Tools
  • Account
Navigate to...
  • Welcome
  • Getting Started
  • 5-Minute Setup Guide
  • Reactor
  • Core Concepts
    • Overview
    • Users
    • Roles
    • Groups
    • Registrations
    • Applications
    • Tenants
    • Identity Providers
    • Authentication and Authorization
    • Integration Points
    • Roadmap
  • Installation Guide
    • Overview
    • System Requirements
    • Server Layout
    • Cluster
    • Docker
    • Fast Path
    • Kickstart™
    • Homebrew
    • Packages
    • Database
    • FusionAuth App
    • FusionAuth Search
    • Securing
    • Upgrading
  • APIs
    • Overview
    • Authentication
    • Errors
    • Actioning Users
    • Applications
    • Audit Logs
    • Connectors
      • Overview
      • Generic
      • LDAP
    • Consent
    • Emails
    • Event Logs
    • Families
    • Forms
    • Form Fields
    • Groups
    • Identity Providers
      • Overview
      • Apple
      • Facebook
      • Google
      • HYPR
      • LinkedIn
      • Twitter
      • OpenID Connect
      • SAML v2
      • External JWT
    • Integrations
    • JWT
    • Keys
    • Lambdas
    • Login
    • Passwordless
    • Registrations
    • Reports
    • System
    • Tenants
    • Themes
    • Two Factor
    • Users
    • User Actions
    • User Action Reasons
    • User Comments
    • Webhooks
  • Client Libraries
    • Overview
    • Dart
    • Go
    • Java
    • JavaScript
    • .NET Core
    • Node
    • PHP
    • Python
    • Ruby
    • Typescript
  • Themes
    • Overview
    • Localization
    • Examples
  • Email & Templates
    • Overview
    • Configure Email
    • Email Templates
  • Events & Webhooks
    • Overview
    • Events
    • Writing a Webhook
    • Securing Webhooks
  • Example Apps
    • Overview
    • Go
    • Java
    • JavaScript
    • .NET Core
    • PHP
    • Python
    • Ruby
  • Lambdas
    • Overview
    • Apple Reconcile
    • External JWT Reconcile
    • Facebook Reconcile
    • Google Reconcile
    • HYPR Reconcile
    • JWT Populate
    • LDAP Connector Reconcile
    • LinkedIn Reconcile
    • OpenID Connect Reconcile
    • SAML v2 Populate
    • SAML v2 Reconcile
    • Twitter Reconcile
  • Identity Providers
    • Overview
    • Apple
    • Facebook
    • Google
    • HYPR
    • LinkedIn
    • Twitter
    • OpenID Connect
      • Overview
      • Azure AD
      • Github
      • Discord
    • SAML v2
      • Overview
      • ADFS
    • External JWT
      • Overview
      • Example
  • Connectors
    • Overview
    • Generic Connector
    • LDAP Connector
    • FusionAuth Connector
  • Integrations
    • Overview
    • CleanSpeak
    • Kafka
    • Twilio
  • OpenID Connect & OAuth 2.0
    • Overview
    • Endpoints
    • Tokens
  • SAML v2 IdP
    • Overview
    • Google
    • Zendesk
  • Plugins
    • Writing a Plugin
    • Password Encryptors
  • Guides
    • Overview
    • Advanced Registration Forms
    • Breached Password Detection
    • Migration
    • Passwordless
    • Securing Your APIs
    • Silent Mode
    • Single Sign-on
  • Tutorials
    • Overview
    • Setup Wizard & First Login
    • Register/Login a User
    • Migrate Users
    • JSON Web Tokens
    • Authentication Tokens
    • Start and Stop FusionAuth
    • Switch Search Engines
    • User Account Lockout
    • Two Factor
  • Reference
    • CORS
    • Configuration
    • Data Types
    • Known Limitations
    • Password Encryptors
  • Release Notes
  • Troubleshooting

Tokens

Overview

When using the OAuth2 and OpenID Connect authentication grants you’ll be dealing with some tokens. We’ll review each token type, the purpose and how to use them.

Here’s a presentation discussing how to use JWTs in a microservices architecture:

Access Token

The access token is an opaque token per the OAuth2 specification. In the FusionAuth implementation the access token is a JSON Web Token (JWT).

Access Token Claims

applicationId [UUID]

The unique Id of the Application for which the User has been authenticated. A JWT can only represent authorization to a single Application.

This claim is only present if the User has a registration to the Application.

To obtain a JWT for another Application you must either authenticate again with a different applicationId using the Authentication API or utilize the Issue a JWT API to exchange a valid JWT for another.

aud [String]

The audience the JWT is intended for. This registered claim is defined by RFC 7519 Section 4.1.3

This claim will be equal to the client_id.

authenticationType [String]

The method used to authenticate the User which resulted in this JWT being generated. The possible values are:

  • APPLE - The User was authenticated using Apple. Available since 1.17.0

  • APPLICATION_TOKEN - The User was authenticated using an Application Authentication Token.

  • FACEBOOK - The User was authenticated using Facebook.   Available since 1.1.0

  • FEDERATED_JWT - The User was authenticated using a JWT from an external Identity Provider.

  • GENERIC_CONNECTOR - The user was authenticated using a generic connector.   Available since 1.18.0

  • GOOGLE - The User was authenticated using Google. Available since 1.1.0

  • HYPR - The User was authenticated using HYPR provider. Available since 1.12.0

  • JWT_SSO - A valid JWT authorized to one Application was exchanged for another JWT authorized to a different Application.

  • LDAP_CONNECTOR - The user was authenticated using an LDAP connector.   Available since 1.18.0

  • LINKEDIN - The user was authenticated using LinkedIn.   Available since 1.23.0

  • ONE_TIME_PASSWORD The User was authenticated using a one time password.   Available since 1.5.0

  • OPENID_CONNECT - The User was authenticated using an external OpenID Connect provider. Available since 1.1.0

  • PASSWORD - The User was authenticated using a loginId and password combination.

  • PASSWORDLESS - The user was authenticated using a passwordless login link.   Available since 1.5.0

  • PING - The user was authenticated using the PING API w/ a valid JWT.

  • REGISTRATION - The user was created using the Registration API.   Available since 1.16.0

  • REFRESH_TOKEN - The User requested a new JWT using a Refresh Token.

  • SAMLv2 - The User was authenticated using an external SAMLv2 provider. Available since 1.6.0

  • TWITTER - The User was authenticated using Twitter. Available since 1.1.0

  • USER_CREATE - The user was created using the User API.   Available since 1.16.0

email [String]

The email address of the User whose claims are represented by this JWT.

email_verified [Boolean]

The OpenId Connect claim indicating if the User’s email has been verified.

exp [Long]

The expiration instant of the JWT expressed as UNIX time which is the number of seconds since Epoch. This registered claim is defined by RFC 7519 Section 4.1.4

iat [Long]

The instant that the JWT was issued expressed as UNIX time which is the number of seconds since Epoch. This registered claim is defined by RFC 7519 Section 4.1.6

jti [String] Available since 1.18.0

The unique identifier for this JWT. This registered claim is defined by RFC 7519 Section 4.1.7

iss [String]

The issuer of the JWT. For FusionAuth, this is always the value defined in the global JWT configuration. This registered claim is defined by RFC 7519 Section 4.1.1

preferred_username [String] Available since 1.5.0

The username of the User who claims are represented by this JWT.

roles [Array<String>]

The roles assigned to the User in the authenticated Application. This claim is only present if the User has a registration to the Application.

sub [UUID]

The subject of the access token. This value is equal to the User’s unique Id in FusionAuth. This registered claim is defined by RFC 7519 Section 4.1.2

Id Token

The Id Token is part of the OpenID Connect specification. The Id Token is a JSON Web Token (JWT) per the OpenID Connect specification. The Id Token is similar to the access token in the FusionAuth implementation. The Id Token may contain additional claims not present in the Access Token.

The Id Token may be returned as part of an Authentication request when the openid scope is requested.

Id Token Claims

applicationId [UUID] Deprecated

The unique Id of the Application for which the User has been authenticated. A JWT can only represent authorization to a single Application.

This claim is only present if the User has a registration to the Application.

To obtain a JWT for another Application you must either authenticate again with a different applicationId using the Authentication API or utilize the Issue a JWT API to exchange a valid JWT for another.

Removed in version 1.24.0 As of version 1.24.0, this claim is no longer returned by default. The id_token should not be utilized for authorization, so this claim was removed to make it less likely for a holder of this token to incorrectly utilize this token. If you have a need for this claim, it can be added back using a JWT populate lambda.

at_hash [String] Available since 1.5.0

The Access Token hash value. As defined by the 3.1.3.6 of the OpenID Connect Core specification this value is a base64 encoded hash of the access token.

aud [String]

The audience the JWT is intended for. This registered claim is defined by RFC 7519 Section 4.1.3

This claim will be equal to the client_id.

authenticationType [String]

The method used to authenticate the User which resulted in this JWT being generated. The possible values are:

  • APPLE - The User was authenticated using Apple. Available since 1.17.0

  • APPLICATION_TOKEN - The User was authenticated using an Application Authentication Token.

  • FACEBOOK - The User was authenticated using Facebook.   Available since 1.1.0

  • FEDERATED_JWT - The User was authenticated using a JWT from an external Identity Provider.

  • GENERIC_CONNECTOR - The user was authenticated using a generic connector.   Available since 1.18.0

  • GOOGLE - The User was authenticated using Google. Available since 1.1.0

  • HYPR - The User was authenticated using HYPR provider. Available since 1.12.0

  • JWT_SSO - A valid JWT authorized to one Application was exchanged for another JWT authorized to a different Application.

  • LDAP_CONNECTOR - The user was authenticated using an LDAP connector.   Available since 1.18.0

  • LINKEDIN - The user was authenticated using LinkedIn.   Available since 1.23.0

  • ONE_TIME_PASSWORD The User was authenticated using a one time password.   Available since 1.5.0

  • OPENID_CONNECT - The User was authenticated using an external OpenID Connect provider. Available since 1.1.0

  • PASSWORD - The User was authenticated using a loginId and password combination.

  • PASSWORDLESS - The user was authenticated using a passwordless login link.   Available since 1.5.0

  • PING - The user was authenticated using the PING API w/ a valid JWT.

  • REGISTRATION - The user was created using the Registration API.   Available since 1.16.0

  • REFRESH_TOKEN - The User requested a new JWT using a Refresh Token.

  • SAMLv2 - The User was authenticated using an external SAMLv2 provider. Available since 1.6.0

  • TWITTER - The User was authenticated using Twitter. Available since 1.1.0

  • USER_CREATE - The user was created using the User API.   Available since 1.16.0

c_hash [String] Available since 1.5.0

The Authorization Code hash value. As defined by the 3.3.2.11 of the OpenID Connect Core specification this value is an encoded hash of the authorization code, the algorithm used to generate this hash depends upon the algorithm used to generate the id_token signature.

email [String]

The email address of the User whose claims are represented by this JWT.

email_verified [Boolean]

The OpenId Connect claim indicating if the User’s email has been verified.

exp [Long]

The expiration instant of the JWT expressed as UNIX time which is the number of seconds since Epoch. This registered claim is defined by RFC 7519 Section 4.1.4

iat [Long]

The instant that the JWT was issued expressed as UNIX time which is the number of seconds since Epoch. This registered claim is defined by RFC 7519 Section 4.1.6

iss [String]

The issuer of the JWT. For FusionAuth, this is always the value defined in the global JWT configuration. This registered claim is defined by RFC 7519 Section 4.1.1

jti [String] Available since 1.18.0

The unique identifier for this JWT. This registered claim is defined by RFC 7519 Section 4.1.7

nonce [String] Available since 1.5.0
preferred_username [String] Available since 1.5.0

The username of the User who claims are represented by this JWT.

roles [Array<String>] Deprecated

The roles assigned to the User in the authenticated Application. This claim is only present if the User has a registration to the Application.

Removed in version 1.24.0 As of version 1.24.0, this claim is no longer returned by default. The id_token should not be utilized for authorization, so this claim was removed to make it less likely for a holder of this token to incorrectly utilize this token. If you have a need for this claim, it can be added back using a JWT populate lambda.

sub [UUID]

The subject of the access token. This value is equal to the User’s unique Id in FusionAuth. This registered claim is defined by RFC 7519 Section 4.1.2

Refresh Token

The refresh token is an opaque token that is used to "refresh", or obtain a new access token. Because the life of an access token is generally measured in minutes, the Refresh Token is by comparison a long lived token that can be used to maintain access to a protected resource.

To request a refresh token during authentication you must provide the offline_access scope. The refresh token is not supported by the Implicit Grant, so if you provide the offline_access scope during an Implicit Grant workflow it will be ignored.

If you request the offline_access scope and an Refresh Token is not returned, ensure that the FusionAuth application has been configured to generate refresh tokens. Ensure Generate refresh tokens is enabled in your application settings. See Settings → Applications → OAuth. This setting will cause a Refresh Token to be returned when the offline_access scope is requested. You will also want to ensure the Refresh Token grant is enabled which allows the use of the Refresh Token to be exchanged for a new Access Token.

Feedback

How helpful was this page?

See a problem?

File an issue in our docs repo

Quick Links

  • Download
  • Cloud Pricing
  • Editions Pricing
  • Contact Us
  • Jobs (come work with us)
  • My Account

Resources

  • Docs
  • Blog
  • Community & Support
  • Upgrade from SaaS
  • Upgrade from Homegrown
  • Upgrade from Open Source

Everything Else

  • Privacy Policy
  • Product Privacy Policy
  • License
  • License FAQ
  • Enterprise Sales FAQ
  • Security (contact, bug bounty, etc)
  • Technical Support

Connect with Us

logo
Subscribe for Updates
We only send dev friendly newsletters. No marketing fluff!
© 2021 FusionAuth