loopback-component-auth
Version:
Extends loopback-component-passport to support custom auth schemes (i.e. other than the supported 'ldap', 'local', 'oauth', 'oauth1', 'oauth 1.0', 'openid', 'openid connect' and 'oauth 2.0')
150 lines (149 loc) • 5.65 kB
JSON
{
"name": "AuthProvider",
"description": "Authentication providers for sign-in and linking user accounts",
"plural": "AuthProviders",
"base": "Model",
"http": {
"path": "/auth/providers"
},
"strict": false,
"options": {
"idInjection": false,
"validateUpsert": false,
"transient": {}
},
"properties": {
"disabled": {
"type": "Boolean",
"default": false,
"description": "Indicates if an authentication provider is mounted / loaded"
},
"name": {
"type": "String",
"id": true,
"description": "Name used to identify an authentication provider"
},
"module": {
"type": "String",
"required": true,
"description": "`name` or `path` of node module that exports the required `passport` strategy. Must be resolveable with `require`"
},
"strategy": {
"type": "String",
"default": "Strategy",
"description": "Name of the `passport` strategy exported by `module`"
},
"strategyOptions": {
"type": "AuthStrategyOptions",
"description": "Define options for `strategy` in an objet literal"
},
"authScheme": {
"type": "String",
"required": true,
"description": ["The authentication scheme you want to use.",
"This can either be one of the schemes supported by `loopback-component-passport`",
"or a custom scheme defined in your `<appRootDir>/authentication`"
]
},
"schemeOptions": {
"type": "AuthSchemeOptions",
"description": "Define options for `authScheme` in an object literal"
},
"link": {
"type": "Boolean",
"default": false,
"description": "Is this authentication provider used for sign-in or to be linked to an existing (authenticated) account"
},
"json": {
"type": "Boolean",
"default": false,
"description": "When set to `true`, this provider responds with `json` data instead of redirects to `successRedirectUrl` and `failureRedirectUrl`"
},
"session": {
"type": "Boolean",
"default": false,
"description": "When set to `true`, uses `express` sessions to remember the originally requested url"
},
"makeLoginCallback": {
"type": "any",
"required": false,
"description": [
"Actual type is `function` and must be set programmatically.",
"`loopback-component-auth` uses this property to allow a custom auth scheme to provide",
"their own `loginCallback` function which is later passed to `authScheme.makeVerifyFunction`"
]
},
"routeOptions": {
"auth": {
"method": {
"type": "String",
"default": "GET",
"description": "HTTP method used to invoke authentication on `routeOptions.auth.path`. Must be one of ['GET', 'POST']"
},
"bodyParser": {
"type": "String",
"required": false,
"description": [
"Name of the `express body-parser` used to parse the `body` portion of `http.IncomingMessage`",
"on `routeOptions.auth.path`. The body-parser middleware is resolved from `loopback.bodyParser` and added immediately",
"befor `routeOptions.auth.middleware` or `passport.authorize()` for `link` providers respectively"
]
},
"bodyParserOptions": {
"type": "Object",
"required": false,
"default": { "extended": true },
"description": "options passed to `routeOptions.auth.bodyParser` on creation"
},
"middleware": {
"type": "any",
"required": false,
"description": [
"Actual type is `function` and must be set programmatically. Function signature must be compatible",
"with `express` middleware.",
"`loopback-component-auth` uses this middleware to handle requests to a non-link provider's `authPath`.",
"When no middleware is provided, `loopback-component-auth` uses a default middleware that initlaizies an OAuth 2.0 flow."
]
}
},
"callback": {
"method": {
"type": "String",
"default": "GET",
"description": "HTTP method used to invoke authentication on `authPath`. Must be one of ['GET', 'POST']"
},
"bodyParser": {
"type": "String",
"required": false,
"description": [
"Name of the `express body-parser` used to parse the `body` portion of `http.IncomingMessage`",
"on `authPath`. The body-parser middleware is resolved from `loopback.bodyParser` and added immediately",
"befor `authMiddleware` or `passport.authorize()` for `link` providers respectively"
]
},
"bodyParserOptions": {
"type": "Object",
"required": false,
"default": { "extended": true },
"description": "options passed to `authBodyParser` on creation"
},
"middleware": {
"type": "any",
"required": false,
"description": [
"Actual type is `function` and must be set programmatically. Function signature must be compatible",
"with `express` middleware.",
"`loopback-component-auth` uses this middleware to handle requests to a non-link provider's `authPath`.",
"When no middleware is provided, `loopback-component-auth` uses a default middleware that initlaizies an OAuth 2.0 flow."
]
}
}
}
},
"hidden": ["clientID", "clientSecret"],
"relations": {},
"acls": [],
"scopes": {},
"scope": {},
"indexes": {}
}