Class Authentication<T>
Type parameters
Hierarchy
-
Service<T>
- Authentication
Constructors
Properties
Methods
Constructors
-
Parameters
-
webda: Core
The main instance of Webda
-
name: string
The name of the service
-
Default value params: any = {}
The parameters block define in the configuration file
Returns Authentication
-
Properties
Service name
Webda Core object
Logger with class context
Hold the parameters for your service
It will be bring from the webda.config.json
Methods
-
Clean the service data, can only be used in test mode
Returns Promise<any>
-
Parameters
-
ctx: Context
Returns Promise<void>
-
-
Parameters
-
ctx: Context
Returns Promise<any>
-
-
Parameters
-
ctx: Context
Returns Promise<void>
-
-
Parameters
-
ctx: Context
Returns Promise<void>
-
-
Parameters
-
ctx: Context
Returns Promise<void>
-
-
Parameters
-
ctx: Context
Returns Promise<void>
-
-
Parameters
-
ctx: any
Returns Promise<void>
-
-
Parameters
-
ctx: any
Returns Promise<void>
-
-
Parameters
-
password: string
Returns Promise<void>
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
name: string
Returns void
-
-
Add a route dynamicaly
Parameters
-
url: string
of the route can contains dynamic part like {uuid}
-
methods: HttpMethodType[]
-
executer: Function
Method to execute for this route
-
Default value openapi: object = {}
-
Default value allowPath: boolean = false
Returns void
-
-
Check the password match the stored hash
Parameters
-
hash: any
generate prior by hashPassword
-
pass: any
Returns boolean
-
-
Parameters
-
event: string | symbol
-
Rest ...args: any[]
Returns boolean
-
-
Emit the event with data and wait for Promise to finish if listener returned a Promise
Parameters
-
event: any
-
data: any
Returns Promise<any[]>
-
-
Returns Array<string | symbol>
-
Parameters
-
user: string
-
email: string
Returns string
-
-
Returns Mailer
-
Returns number
-
Get service name
Returns string
-
Get the service parameters
Returns T
-
Parameters
-
uuid: string | User
-
Default value interval: number = this.parameters.email.delay
Returns Promise<PasswordRecoveryInfos>
-
-
Return a webda service
Type parameters
Parameters
-
service: string
name to retrieve
Returns T
-
-
Returns string
-
Return WebdaCore
Returns Core
-
Create a SHA256 of the info
Parameters
-
info: string
to hash
Returns string
-
-
Hash the password according to good practices
Parameters
-
pass: string
to hash
Returns string
-
-
Will be called after all the Services are created
Returns Promise<void>
-
Returns void
-
Parameters
-
type: string | symbol
Returns number
-
-
Parameters
-
event: string | symbol
Returns Function[]
-
-
Load the parameters for a service
Parameters
-
params: any
Returns AuthenticationParameters
-
-
Parameters
-
level: WorkerLogLevel
to log
-
Rest ...args: any[]
Returns void
-
-
Parameters
-
ctx: Context
-
user: any
-
ident: any
Returns Promise<any[]>
-
-
Parameters
-
ctx: Context
Returns Promise<void>
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Listen to an event as on(...) would do except that it will be asynchronous
Parameters
-
event: any
-
callback: any
-
Default value queue: string = undefined
Name of queue to use, can be undefined, queue name are used to define differents priorities
Returns void
-
-
Parameters
-
ctx: Context
-
provider: string
-
identId: string
-
profile: any
Returns Promise<void>
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
Returns Function[]
-
-
Parameters
-
ctx: Context
-
datas: any
-
Default value user: any = {}
Returns Promise<any>
-
-
Parameters
-
config: any
new parameters for the service
Returns Promise<void>
-
-
Parameters
-
Optional event: string | symbol
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Resolve parameters Call initRoutes and initBeanRoutes
Returns void
-
Parameters
-
ctx: Context
-
user: any
-
email: string
Returns Promise<any>
-
-
Parameters
-
ctx: Context
-
email: string
Returns Promise<any>
-
-
Parameters
-
identStore: any
Returns void
-
-
Parameters
-
n: number
Returns this
-
-
Parameters
-
userStore: any
Returns void
-
-
Convert an object to JSON using the Webda json filter
Parameters
-
object: any
The object to export
Returns string
The export of the strip object ( removed all attribute with _ )
-
-
Returns ModdaDefinition
-
Parameters
-
emitter: EventEmitter
-
event: string | symbol
Returns number
-
Generated using TypeDoc
This class is known as the Authentication module It handles OAuth for several providers for now (Facebook, Google, Amazon, GitHub and Twitter) It also handles email authentication with prevalidation or postvalidation of the email
It requires two Store to work one
idents
and oneusers
The parameters are
providerName: { clientID: '...', clientSecret: '...', scope: '' }, email: { postValidation: true|false // If postValidation=true, account created without email verification } url: 'url' // By default /auth