STORMPATH_CONFIG
stormpath
This constant allows you to configure the internal settings of the module, such as authentication endpoints and the names of events. These properties must be modified within a config block.
Example:
angular.module('myapp')
.config(function(STORMPATH_CONFIG){
STORMPATH_CONFIG.ENDPOINT_PREFIX = 'http://api.mydomain.com';
});
Default: /login
The URI that the login form will post to. The endpoint MUST accept data in the following format:
{
username: '',
password: ''
}
Default: $authenticationFailure
The name of the event that is fired when the user posts invalid login credentials to the login form.
Default: $authenticated
The name of the event that is fired when a user logs in, after successfully submitting the login form.
Default: $auth
The name of the authentication service, this changes the service name that you inject.
Default: /change
The endpoint that is used by $user.verifyPasswordResetToken() and $user.resetPassword() to verify and consume password reset tokens (change a user's password with the token).
Default: /me
The URI that is used to fetch the account object of the currently logged in user. This endpoint MUST:
401 Unauthorized if the user has no session.Default: /logout
The URL that the spLogout directive will make a GET request to, this endpoint MUST delete the access token cookie, XSRF token cookie, and any other cookies that relate to the user session.
Default: /verify
The endpoint that is used for verifying an account that requires email
verification. Used by
$user.verify() to POST
the sptoken that was delivered to the user by email.
This endpoint MUST accept a POST request with the following format and use Stormpath to verify the token:
{
sptoken: '<token from email sent to user>'
}
Default: none
A prefix, e.g. "base URL" to add to all endpoints that are used by this SDK. Use this if your backend API is running on a different port or domain than your Angular application. Omit the trailing forward slash.
NOTE: This may trigger CORS behaviour in the browser, and your server will need to respond to requests accordingly. If you are using our Express SDK see allowedOrigins
Example:
ENDPOINT_PREFIX = 'http://api.mydomain.com'
Default: /forgot
The endpoint that is used by $user.passwordResetRequest() to create password reset tokens.
Default: $currentUser
The name of the event that is fired when $user.get() is resolved with a user object.
Default: $notLoggedin
The name of the event that is fired when $user.get() is rejected without a user.
Default: /oauth/token
The endpoint that is used to authenticate and refresh using OAuth tokens. This endpoint MUST support password and refresh_token grant authentication flows.
Default: localStorage
The default type of local storage used by stormpath.oauth.StormpathOAuthTokenProvider.
Default: $oAuthRequestError
The name of the event that is fired when the user attempts OAuth-based authentication, and fails due to an OAuth issue.
The name under which tokens are stored in the token storage mechanism. Might not be relevant if the underlying storage mechanism is not key-value based.
See TokenStoreManager for more detail.
Default: /oauth/revoke
The endpoint that is used to revoke OAuth tokens.
Default: $registered
The name of the event that is fired when $user.create() is resolved with an account that was successfully created
Default: /register
The endpoint that is used by $user.create() to POST new users. This endpoint MUST accept a stormpath account object and use Stormpath to create the new user.
Default: $routeChangeUnauthenticated
The name of the event that is fired when the user attempts to visit a route that requires authentication, but the user is not authenticated.
Default: $sessionEnd
The name of the event that is fired when the user logs out via the spLogout directive
Default: $stateChangeUnauthenticated
The name of the event that is fired when the user attempts to visit a UI Router state that requires authentication, but the user is not authenticated.