Skip to content

Latest commit

 

History

History
82 lines (53 loc) · 14.4 KB

File metadata and controls

82 lines (53 loc) · 14.4 KB
description
User, Session, Client resources and mechanics explained

User, Session, Client resources

User

This table outlines the attributes of the User resource and their descriptions.

pathtypedescription
User.activebooleanIgnored Attribute. Indicates the user's administrative status.
User.addressesarray of objectsA collection of physical mailing addresses for the user. Common types: 'work', 'home', 'other'. Each entry may include the fields below.
User.addresses.countrystringCountry name component of the address.
User.addresses.formattedstringThe full mailing address formatted for display or label printing. May contain newlines.
User.addresses.localitystringThe city or locality component.
User.addresses.postalCodestringThe zip or postal code component.
User.addresses.regionstringThe state or region component.
User.addresses.streetAddressstringThe full street address, possibly multiline (e.g., house number, street name, etc.). May contain newlines.
User.addresses.typestringA label for the address function, e.g., 'work' or 'home'.
User.costCenterstringThe name of a cost center associated with the user.
User.dataanyArbitrary user-related data.
User.departmentstringThe name of a department associated with the user.
User.displayNamestringThe user's display name, ideally their full name.
User.divisionstringThe name of a division associated with the user.
User.emailemailThe user's primary email address.
User.emailsarray of objectsA collection of the user's email addresses. The service should provide canonical forms, e.g., lowercase. Common types: 'work', 'home', 'other'.
User.emails.displaystringA human-readable label for the email address (read-only).
User.emails.primarybooleanIndicates if this is the primary/preferred email. Only one can be true.
User.emails.typestringThe function label for the email (e.g., 'work', 'home').
User.emails.valuestringThe user's email address, canonicalized.
User.employeeNumberstringA numeric or alphanumeric identifier assigned by the organization.
User.entitlementsarray of objectsA list of entitlements the user has.
User.entitlements.displaystringA human-readable label for the entitlement (read-only).
User.entitlements.primarybooleanIndicates if this entitlement is primary. Only one can be true.
User.entitlements.typestringA label indicating the entitlement's function.
User.entitlements.valuestringThe value of the entitlement.
User.fhirUserReferenceA reference to a related FHIR resource (Patient, Practitioner, or Person).
User.genderstringThe user's gender.
User.identifierarray of IdentifierA list of identifiers for the user.
User.imsarray of objectsA collection of instant messaging addresses for the user.
User.ims.displaystringA human-readable label for the IM address (read-only).
User.ims.primarybooleanIndicates if this IM address is primary. Only one can be true.
User.ims.typestringThe function label for the IM address (e.g., 'aim', 'gtalk').
User.ims.valuestringThe user's instant messaging address.
User.inactivebooleanIndicates the user's administrative status.
User.linkarray of objectsA collection of references or links associated with the user.
User.link.linkReferenceA referenced resource link.
User.link.typestringA label indicating the link's function.
User.localestringThe user's default locale, used for localization (e.g., formatting dates, numbers).
User.managerReferenceThe user's manager, referencing another user by id.
User.nameobjectThe components of the user's real name.
User.name.familyNamestringThe user's family (last) name.
User.name.formattedstringThe user's full name, formatted for display.
User.name.givenNamestringThe user's given (first) name.
User.name.honorificPrefixstringThe user's honorific prefix(es), e.g., 'Ms.'.
User.name.honorificSuffixstringThe user's honorific suffix(es), e.g., 'III'.
User.name.middleNamestringThe user's middle name(s).
User.organizationReferenceA reference to the user's associated organization.
User.passwordpasswordThe user's cleartext password, used for initial setup or resets.
User.phoneNumberstringThe user's primary phone number.
User.phoneNumbersarray of objectsA collection of phone numbers for the user. Common types: 'work', 'home', 'mobile', etc. Should follow RFC 3966.
User.phoneNumbers.displaystringA human-readable label for the phone number (read-only).
User.phoneNumbers.primarybooleanIndicates if this phone number is primary. Only one can be true.
User.phoneNumbers.typestringThe function label for the phone number (e.g., 'work', 'home').
User.phoneNumbers.valuestringThe user's phone number.
User.photouriThe user's primary photo.
User.photosarray of objectsA collection of photo URLs for the user.
User.photos.displaystringA human-readable label for the photo (read-only).
User.photos.primarybooleanIndicates if this photo is primary. Only one can be true.
User.photos.typestringThe function label for the photo, e.g., 'photo' or 'thumbnail'.
User.photos.valueuriThe URL of a user photo.
User.preferredLanguagestringThe user's preferred language (e.g., 'en_US').
User.profileUrluriA URL pointing to the user's online profile.
User.rolesarray of objectsA collection of roles for the user, e.g., 'Student', 'Faculty'.
User.roles.displaystringA human-readable label for the role (read-only).
User.roles.primarybooleanIndicates if this role is primary. Only one can be true.
User.roles.typestringA label indicating the role's function.
User.roles.valuestringThe value of the role.
User.securityLabelarray of objectsA list of security labels associated with the user.
User.securityLabel.codestringThe code value of the security label.
User.securityLabel.systemstringThe code system of the security label.
User.timezonestringThe user's time zone, in Olson format (e.g., 'America/Los_Angeles').
User.titlestringThe user's title, e.g., "Vice President."
User.twoFactorobjectTwo-factor authentication (2FA) settings for the user.
User.twoFactor.enabledbooleanIndicates if two-factor authentication is currently enabled.
User.twoFactor.secretKeystringThe TOTP secret key for 2FA.
User.twoFactor.transportstringThe method of delivering the 2FA code. If absent, no code is sent.
User.userNamestringA required unique identifier used by the user for authentication.
User.userTypestringDefines the relationship between the organization and the user (e.g., 'Employee', 'Contractor').
User.x509Certificatesarray of objectsA collection of X.509 certificates issued to the user.
User.x509Certificates.displaystringA human-readable label for the certificate (read-only).
User.x509Certificates.primarybooleanIndicates if this certificate is primary. Only one can be true.
User.x509Certificates.typestringA label indicating the certificate's function.
User.x509Certificates.valuebase64BinaryThe value of the X.509 certificate.

Sessions

For each user login Aidbox creates Session resource

{% code title="Get last 10 sessions" %}

select cts, resource#>>'{user,id}'
from session
order by cts desc
limit 10

{% endcode %}

Session expiration

Basically, all sessions stored in Aidbox are infinite, and you have to manage session expiration by yourself manually.

However since Aidbox v:2205 Session.exp field was added. It represents NumericDate from RFC7519 and it identifies the expiration time after which the Session will not be accepted for processing.

You can specify auth.*.access_token_expiration (in seconds) on Client resource, so Session.exp field will be propagated once corresponding grant_type is used to launch a Session.

Session expiration for Aidbox UI

In Aidbox version v:2402 and later, sessions created through the Aidbox UI log-in are not infinite. The default session expiration time is set to 432000 seconds (5 days). To change the default time, create an AuthConfig resource and set the asidCookieMaxAge to the desired value:

PUT /AuthConfig/my-auth-config
content-type: text/yaml
accept: text/yaml

asidCookieMaxAge: 86400 # seconds

Client

To provide programmatic access to Aidbox you have to register a Client resource.

Client.audience

A Client can have the audience attribute. The audience shows what resource server access is intended for. Aidbox compares the audience of the Client to the audience it receives within aJWT and decides if the access should be granted.

The audience attribute can be defined in 2 ways:

  • As a plain string. For example, https://cmpl.aidbox.app/smart
  • As a Regex. In that case, the audience value should start with the # symbol. For example, #https://cmpl.aidbox.app/tenant/[^\]/smart

{% hint style="info" %} That validation of the audience happens when SMART on FHIR app launches {% endhint %}

Client.grant_types

Client resource must have grant_types attribute defining authentification scheme for this Client.

Application grant types (or flows) are methods through which applications can gain Access Tokens and by which you grant limited access to your resources to another entity without exposing credentials.

Grant types are choosed appropriately based on the grant_types property of your Auth0-registered Application. The OAuth 2.0 protocol supports several types of grants, which allow different types of access. To see available grant types and grant type mapping refer to the doc.

Other required attributes are determined based on the values of this attribute grant_types is an array of strings, possible values are:

  • basic
  • client_credentials
  • password
  • implicit
  • authorization_code
  • code

{% hint style="info" %} You can find different authorization flow examples in the Auth Sandbox in the Aidbox ui {% endhint %}