AuthenticationMethod
AuthenticationMethod
An AuthenticationMethod represents the means by which a User is authenticated. There are two kinds: NativeAuthenticationMethod and ExternalAuthenticationMethod.
class AuthenticationMethod extends VendureEntity {
@Index()
@ManyToOne(type => User, user => user.authenticationMethods)
user: User;
}
- Extends:
VendureEntity
ExternalAuthenticationMethod
This method is used when an external authentication service is used to authenticate Vendure Users. Examples of external auth include social logins or corporate identity servers.
class ExternalAuthenticationMethod extends AuthenticationMethod {
constructor(input: DeepPartial<ExternalAuthenticationMethod>)
@Column()
strategy: string;
@Column()
externalIdentifier: string;
@Column('simple-json')
metadata: any;
}
- Extends:
AuthenticationMethod
constructor
(input: DeepPartial<ExternalAuthenticationMethod>) => ExternalAuthenticationMethod
strategy
string
externalIdentifier
string
metadata
any
NativeAuthenticationMethod
This is the default, built-in authentication method which uses a identifier (typically username or email address) and password combination to authenticate a User.
class NativeAuthenticationMethod extends AuthenticationMethod {
constructor(input?: DeepPartial<NativeAuthenticationMethod>)
@Column()
identifier: string;
@Column({ select: false }) passwordHash: string;
@Column({ type: 'varchar', nullable: true })
verificationToken: string | null;
@Column({ type: 'varchar', nullable: true })
passwordResetToken: string | null;
@Column({ type: 'varchar', nullable: true })
identifierChangeToken: string | null;
@Column({ type: 'varchar', nullable: true })
pendingIdentifier: string | null;
}
- Extends:
AuthenticationMethod
constructor
(input?: DeepPartial<NativeAuthenticationMethod>) => NativeAuthenticationMethod
identifier
string
passwordHash
string
verificationToken
string | null
passwordResetToken
string | null
identifierChangeToken
string | null
A token issued when a User requests to change their identifier (typically an email address)
pendingIdentifier
string | null
When a request has been made to change the User's identifier, the new identifier
will be stored here until it has been verified, after which it will
replace the current value of the identifier
field.