Manual Reference Source Test
import IdentityAPI from 'src/modules/identity-api.js'
public class | source

IdentityAPI

Authentication API calls

Constructor Summary

Public Constructor
public

constructor(options: Object, useCookie: Boolean)

Method Summary

Public Methods
public

externalRegister(idToken: string, type: string, options: Object): Promise

Register external library user

public

externalSession(idToken: string, type: string, options: Object): Promise

Get external library user session

public

getUserInfo(token: string, userData: Object, options: Object): Promise

Get user info by token

public

loginByEmail(email: string, password: string, options: Object): Object

Login user using email address and password

public

registerByEmail(user: Object, options: Object): Promise

Register user by email address and password

public

unauthenticate(token: string, nativeController: function, options: Object): Promise<Identity, Error>

Unauthenticate user

public

updateProfile(token: string, revisionId: number, userId: string, properties: Object, options: Object): Promise

Update user profile properties

Public Constructors

public constructor(options: Object, useCookie: Boolean) source

Params:

NameTypeAttributeDescription
options Object
  • optional
  • default: {}

Options

options.server IdentityServer
  • optional

Server instance api methods are called on.

options.config IdentityConfig
  • optional

Identity config object

useCookie Boolean

Enable Identity Cookie module

Public Methods

public externalRegister(idToken: string, type: string, options: Object): Promise source

Register external library user

Params:

NameTypeAttributeDescription
idToken string

Auth token

type string

External library type

options Object

Additional options

options.headers Object

additional headers to add to the call

Return:

Promise

public externalSession(idToken: string, type: string, options: Object): Promise source

Get external library user session

Params:

NameTypeAttributeDescription
idToken string

Auth token

type string

External library type

options Object

Additional options

options.headers Object

additional headers to add to the call

Return:

Promise

public getUserInfo(token: string, userData: Object, options: Object): Promise source

Get user info by token

Params:

NameTypeAttributeDescription
token string

IDM session token

userData Object

existing user data

options Object

additional options

options.headers Object

additional headers to add to the call

Return:

Promise

Promise of userinfo

public loginByEmail(email: string, password: string, options: Object): Object source

Login user using email address and password

Params:

NameTypeAttributeDescription
email string

User email address

password string

User password

options Object

Additional options

options.headers Object

additional headers to add to the call

Return:

Object

IDM response

public registerByEmail(user: Object, options: Object): Promise source

Register user by email address and password

Params:

NameTypeAttributeDescription
user Object

User properties

user.mail string

User email address

user.password string

User password

user.userName string
  • optional
  • default: user.mail

User name

user.givenName string
  • optional

User given name

user.sn string
  • optional

User surname

user.termsAndConditionsAgreementDate number
  • optional

Unix timestamp at which terms where agreed to

user.facebookId string
  • optional

User Facebook id

options Object

Additional options

options.headers Object

additional headers to add to the call

Return:

Promise

Promise of IDM response

public unauthenticate(token: string, nativeController: function, options: Object): Promise<Identity, Error> source

Unauthenticate user

Params:

NameTypeAttributeDescription
token string

IDM session token

nativeController function

native flag, defaults to false

options Object

Additional options

options.headers Object

additional headers to add to the call

Return:

Promise<Identity, Error>

Promise of unauthenticated Identity

Test:

public updateProfile(token: string, revisionId: number, userId: string, properties: Object, options: Object): Promise source

Update user profile properties

Params:

NameTypeAttributeDescription
token string

IDM session token

revisionId number

Profile revision id

userId string

IDM user id

properties Object

User profile properties to change

options Object

Additional options

options.headers Object

additional headers to add to the call

Return:

Promise

Promise of user info