Skip to main content

Class: StrategyInstance

model/postgres/StrategyInstance.entity.StrategyInstance

Entity representing an instance of a strategy including its config.

For example one GiHub instance as instance of strategy type GitHub.

One StrategyInstance equates to 0-n IMSs of the same template in the backend which all reference the same ims instance.

Constructors

constructor

new StrategyInstance(type)

Parameters

NameTypeDescription
typestringThe strategy this is an instance of

Defined in

login-service/src/model/postgres/StrategyInstance.entity.ts:18

Properties

doesImplicitRegister

doesImplicitRegister: boolean

If true, a user automatically gets a registration token, if they tried to login and an account was not found but the user provided credentials (i.e. sucessfully authenticated with the 3rd party). Needs Strategy.allowsImplicitSignup to be true.

If false, login fails if no known user was found.

Example

false

Defined in

login-service/src/model/postgres/StrategyInstance.entity.ts:107


id

id: string

The unique ID of this strategy instance

Example

12345678-90ab-cdef-fedc-ab0987654321

Defined in

login-service/src/model/postgres/StrategyInstance.entity.ts:28


instanceConfig

instanceConfig: object

The configuration of the instance needed to perform authentication with it.

The data this contains is up to the strategy this is an instance of. For example client id + client secret; urls etc.

Defined in

login-service/src/model/postgres/StrategyInstance.entity.ts:51


isLoginActive

isLoginActive: boolean

If true, this strategy instance allows login of registered users to retrieve an access token. Additionally the strategy must have Strategy.canLoginRegister set to true

If false, users are not allowed to login using this instance.

Example

true

Defined in

login-service/src/model/postgres/StrategyInstance.entity.ts:72


isSelfRegisterActive

isSelfRegisterActive: boolean

If true users can create an account themselves with the registration token they obtained from this instance. Additionally the strategy must have Strategy.canLoginRegister set to true

If false accounts cannot be created without being admin.

Example

true

Defined in

login-service/src/model/postgres/StrategyInstance.entity.ts:83


isSyncActive

isSyncActive: boolean

If true, and Strategy.canSync is true, the sync service can retrieve access tokens for ims users from this strategy instnce.

If false, no tokens will be handed out for the instance

Example

false

Defined in

login-service/src/model/postgres/StrategyInstance.entity.ts:94


name

name: string

An optional human readable name for the strategy.

Can be displayes in a UI etc. but is not necesarrily unique.

Can only contain [A-Za-z0-9_-/+= ]*

Example

"Github-Enterprise-Example"

Defined in

login-service/src/model/postgres/StrategyInstance.entity.ts:41


type

Readonly type: string

The unique string name of the strategy this is an instance of

The strategy of an instance is set on initialization and cannot be changed

Example

"userpass"

Defined in

login-service/src/model/postgres/StrategyInstance.entity.ts:61

Methods

toJSON

toJSON(): Object

Returns

Object

NameType
doesImplicitRegisterboolean
idstring
isLoginActiveboolean
isSelfRegisterActiveboolean
isSyncActiveboolean
namestring
typestring

Defined in

login-service/src/model/postgres/StrategyInstance.entity.ts:109