Skip to content

session_info

session_info returns selected claims from the access token stored by a session middleware.

yaml
server:
  http:
    middlewares:
      current_user:
        session_info:
          session_middleware: session
          information:
            values:
              - preferred_username
              - email
            custom:
              source: turna
            roles: true
            scopes: true
FieldDescription
session_middlewareSession middleware instance name.
information.valuesClaim keys copied into the response.
information.customExtra static values added to the response.
information.rolesInclude roles parsed from the token.
information.scopesInclude scopes parsed from the token.

The route should usually run after the browser has already logged in, but it does not need to chain session in the same router because it reads the session store by middleware name.