new Auth(config) → {Object}
Status: Stable
The AeroGear.Auth namespace provides an authentication and enrollment API. Through the use of adapters, this library provides common methods like enroll, login and logout that will just work.
Parameters:
Name | Type | Argument | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
String | Array | Object |
<optional> |
A configuration for the modules(s) being created along with the authenticator. If an object or array containing objects is used, the objects can have the following properties:
Properties
|
- Source:
Returns:
The created authenticator containing any auth modules that may have been created
- Type
- Object
Example
// Create an empty authenticator
var auth = AeroGear.Auth();
// Create a single module using the default adapter
var auth2 = AeroGear.Auth( "myAuth" );
// Create multiple modules using the default adapter
var auth3 = AeroGear.Auth( [ "someAuth", "anotherAuth" ] );
// Create a single module by passing an object using the default adapter
var auth4 = AeroGear.Auth(
{
name: "objectAuth"
}
);
// Create multiple modules by passing an array of objects using the default adapter
var auth5 = AeroGear.Auth([
{
name: "objectAuth"
},
{
name: "objectAuth2",
settings: { ... }
}
]);
Members
-
<static> adapters
-
The adapters object is provided so that adapters can be added to the AeroGear.Auth namespace dynamically and still be accessible to the add method
- Source:
-
<static> this.collectionName :Object
-
The name used to reference the collection of authentication module instances created from the adapters
Type:
- Object
- Default Value:
- modules
- Source: