Install
npm install swagger-magic-auth-interface --save
#swagger-magic-auth-interface
auth interface for the swagger-magic module
Example
var auth = require("swagger-magic-auth-interface");
Members
##auth~authorize
indicates the callback if the user with the given details is authorized for making the current call
Params
- token
String - the authenticated token
- scopes
Array - the scopes of the current request
- (Function(boolean)) - done - the callback to call when result ready
Scope: inner member of swagger-magic-auth-interface
Example
auth.authorize(token, scopes, done)
##auth~authenticate
indicates the callback if the user with the given details is authenticated or not
Params
- username
String - the username to be checked
- password
String - the password to test against
- (Function(err,user)) - done - the callback to call when result ready
Scope: inner member of swagger-magic-auth-interface
Example
auth.authenticate(username, password, done)