5.15.0 • Published 5 years ago

ut-identity v5.15.0

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
5 years ago

ut-identity

The identity module defines an authentication API in ut5. The API deals with identifying the user that is associated with specific request or message. The module aims to support various methods of identifying the user, such as username/password, session, fingerprint, etc. The module provides a default functionality and allows overriding the default functionality in each implementation. API is defined in the "identity" namespace and consists of the following methods:

identity.check(auth)

This method validates the user identity and optionally creates a session.

Parameters:

auth - an object, containing properties that allow the following functionality:

  • auth.username, auth.password - when these are provided, the identity is determined based on username and password.
  • auth.newPassword - when password has expired
  • auth.fingerPrint - when this is provided, the identity is determined based on biometric scan of the user's finger.
  • auth.userId - when this is provided together with auth.fingerPrint, then the fingerprint is only matched against the specified user.
  • auth.sessionId - when this is provided, the identity is determined by the existence of an active session with the specified id.
  • auth.twoFA - two factor authentication specific data can be passed in this property.
  • auth.channel - used to limit session count per channel.
  • auth.sso - single sign on specific data can be passed in this property.
  • auth.sessionData - an optional object, which determines if a session should be created during the authentication and what data to be persisted in the session. This object can contain arbitrary properties, but the following are recognized by the standard built in functionality:
    • auth.sessionData.language - sets the language for the session.

Result:

The method returns a promise object that can have the following properties:

For successful authentication:

  • userId - id of the identified user.
  • sessionId - id of the created session (optional).
  • groups - list of groups that this user belongs to (optional).
  • roles - list of roles assigned to this user (optional).
  • rights - map of the effective rights assigned to this user (optional).

If any of the groups, roles and rights properties is returned, it is mandatory that identity.reloadSession method is implemented and invoked at appropriate places, where groups, roles and rights of the user may change.

For unsuccessful authentication:

  • errorCode - unique code (string), that identifies the error.
  • errorMessage - debug message that can be logged to the audit log.
  • errorPrint - user friendly error message.

identity.closeSession(criteria)

This method closes user's session.

Parameters:

criteria - an object, containing properties that allow the following functionality:

  • criteria.sessionId - determines the id of the session to be closed.
  • criteria.userId - causes all sessions of the specified user to be closed.
  • criteria.channel - used to limit closing of session per channel when closing more sessions (optional)

Result:

For success returns an array containing the identifiers of the closed sessions. For error returns an error object similar to the identity.check method.

identity.reloadSession(criteria)

This method reloads cached session data for users.

Parameters:

criteria - an object, containing properties that define sessions for which users to be reloaded. The following properties are supported by default:

  • criteria.userId - array used to limit reloading to the specified user ids.
  • criteria.group - array used to limit reloading to the specified user groups.
  • criteria.role - array used to limit reloading to the specified user roles.

Result:

For success returns an array containing the identifiers of the reloaded sessions. For error returns an error object similar to the identity.check method.

identity.changePassword(auth)

This method changes user's password.

Parameters:

auth - an object, containing properties that allow the following functionality:

  • auth.userId - determines the for which user to change the password
  • auth.password - specifies the new password
  • auth.expire - boolean property, making the password to expire immediately. Depending on policies, an empty password may be allowed when auth.expire is true.
5.14.10

5 years ago

5.14.9

5 years ago

5.15.1

5 years ago

5.14.7

5 years ago

5.14.6

5 years ago

5.14.5

5 years ago

5.11.0-mpay.2

5 years ago

5.11.0-mpay.1

5 years ago

5.11.0-mpay.0

5 years ago

5.14.4

6 years ago

5.14.3

6 years ago

5.14.2

6 years ago

5.15.0

6 years ago

5.15.0-rc.4

7 years ago

5.15.0-rc.3

7 years ago

5.15.0-rc.1

7 years ago

5.14.1

7 years ago

5.14.0

7 years ago

5.13.24

7 years ago

5.13.23

7 years ago

5.13.22

7 years ago

5.13.21

7 years ago

5.13.20

7 years ago

5.13.19

7 years ago

5.13.18

7 years ago

5.13.17

7 years ago

5.13.17-app-id.0

7 years ago

5.13.16

7 years ago

5.13.15

7 years ago

5.13.14

7 years ago

5.13.13

7 years ago

5.13.12

7 years ago

5.13.11

7 years ago

5.13.10

7 years ago

5.13.9

7 years ago

5.13.8

7 years ago

5.13.7

7 years ago

5.13.6

7 years ago

5.13.6-vb1.0

7 years ago

5.13.5

7 years ago

5.13.4

7 years ago

5.13.3

7 years ago

5.13.2

7 years ago

5.13.1

7 years ago

5.13.0

7 years ago

5.12.6

7 years ago

5.12.5

7 years ago

5.12.4

7 years ago

5.12.3

7 years ago

5.12.2

7 years ago

5.12.1

7 years ago

5.12.0

7 years ago

5.11.0

7 years ago

5.10.61

7 years ago

5.10.60

7 years ago

5.10.59

7 years ago

5.10.58

7 years ago

5.10.57

7 years ago

5.10.56

7 years ago

5.10.55

7 years ago

5.10.54

7 years ago

5.10.53

7 years ago

5.10.52

7 years ago

5.10.51

7 years ago

5.10.50

7 years ago

5.10.49

7 years ago

5.10.48

7 years ago

5.10.47

7 years ago

5.10.46

7 years ago

5.10.45

7 years ago

5.10.44

7 years ago

5.10.43

7 years ago

5.10.42

7 years ago

5.10.41

7 years ago

5.10.40

7 years ago

5.10.39

7 years ago

5.10.38

7 years ago

5.10.37

7 years ago

5.10.36

7 years ago

5.10.35

7 years ago

5.10.34

7 years ago

5.10.33

7 years ago

5.10.32

7 years ago

5.10.31

7 years ago

5.10.30

7 years ago

5.10.29

7 years ago

5.10.28

7 years ago

5.10.27

7 years ago

5.10.26

7 years ago

5.10.25

7 years ago

5.10.24

7 years ago

5.10.23

7 years ago

5.10.22

7 years ago

5.10.21

7 years ago

5.10.20

7 years ago

5.10.19

7 years ago

5.10.18

7 years ago

5.10.17

7 years ago

5.10.16

7 years ago

5.10.15

7 years ago

5.10.14

7 years ago

5.10.13

7 years ago

5.10.12

7 years ago

5.10.11

7 years ago

5.10.10

7 years ago

5.10.9

7 years ago

5.10.8

7 years ago

5.10.7

7 years ago

5.10.6

7 years ago

5.10.5

7 years ago

5.10.4

7 years ago

5.10.3

7 years ago

5.10.2

7 years ago

5.10.1

7 years ago

5.10.0

8 years ago

5.9.2

8 years ago

5.9.1

8 years ago

5.9.0

8 years ago

5.8.0

8 years ago

5.7.8

8 years ago

5.7.7

8 years ago

5.7.6

8 years ago

5.7.5

8 years ago

5.7.4

8 years ago

5.7.3

8 years ago

5.7.2

8 years ago

5.7.1

8 years ago

5.7.0

8 years ago

5.6.6

8 years ago

5.6.5

8 years ago

5.6.4

8 years ago

5.6.3

8 years ago

5.6.2

8 years ago

5.6.1

8 years ago

5.6.0

8 years ago

5.5.1

8 years ago

5.5.0

8 years ago

5.4.13

8 years ago