Class: Base64Adapter

Base64Adapter

Create osmBase64 angular service instance. This can be used as osmAPI adapter.

new Base64Adapter($base64, $http, osmx2js)

the constructor
Parameters:
Name Type Description
$base64 Object service provided by angular-base64 module
$http Object angular $http service
osmx2js Object angular-osm service to transform response from xml to object
Source:

Methods


clearCredentials()

remove credentials from the localstorage
Source:
Returns:
HTTP Header 'Basic CREDENTIAL AS BASE64'
Type
string

getAuthorization()

compute authorization header from credentials
Source:
Returns:
HTTP Header 'Basic CREDENTIAL AS BASE64'
Type
string

getCredentials()

if you don't use oauth, you can manage credentials here using base64 headers
Source:
Returns:
crendentials from the last set
Type
string

setCredentials(username, password)

if you don't use oauth, you can save credentials here using base64 localstorage (completly unsecure)
Parameters:
Name Type Description
username string your username
password string the user password. WARNING base64 is unsafe and the credentials are stored in the localstorage
Source:
Returns:
crendentials
Type
string

xhr(options)

the main method used to do the call to the API
Parameters:
Name Type Description
options Object
Source:
Returns:
$http response
Type
Promise