...
User-authentication - this corresponds to a Selfcare use-case scenario. The authentication is done by validation username/password in the USERS table. An URL example for this scenario is (note grant_type=password value):
Code Block title Authorization Authentication URL https://host:port/appcontext/oauth/token?username=#myusername&password=#mypassword&grant_type=password&brandKey=#myBrandKey
Code Block title CURL example CURL example: curl -v -X POST -u myclientid:myclientsecret http://host:port/appcontext/oauth/token -H "Accept: application/json" -d "grant_type=password&username=#myusername&password=mypassword&brandKey=#myBrandKey" where: #myusername, #mypassword are taken from Users table #myBrandKey is taken from the Brand table myclientid, myclientsecret are taken from OAUTH_CLIENT_DETAILS table
Code Block title Angular example function login(credentials) { var data = 'username=' + encodeURIComponent(credentials.username) + '&password=' + encodeURIComponent(credentials.password) + '&grant_type=password&scope=read%20write&' + 'client_id=myclientid&' + 'brandKey=myBrandKey'; return $http .post('/oauth/token', data, { headers : { 'Content-Type' : 'application/x-www-form-urlencoded', 'Accept' : 'application/json', 'Authorization' : 'Basic ' + base64Service.encode('myclientid' + ':' + 'myclientsecret') } }).success( function(response) { //store the access token return response; }); } where: credentials.username, credentials.password are taken from Users table myBrandKey is taken from the Brand table myclientid, myclientsecret are taken from OAUTH_CLIENT_DETAILS table
Operator-authentication - this correspnds to a Customercare use-case scenario. The authentication is done by validation username/password in the OPERATORS table. An URL example for this scenario is (note grant_type=operator_password value):
Code Block title Authorization URL https://host:port/appcontext/oauth/token?username=#myusername&password=#mypassword&grant_type=operator_password&brandKey=#myBrandKey
Code Block title CURL example CURL example: curl -v -X POST -u myclientid:myclientsecret http://host:port/appcontext/oauth/token -H "Accept: application/json" -d "grant_type=operator_password&username=#myusername&password=mypassword&brandKey=#myBrandKey" where: #myusername, #mypassword are taken from Operators table #myBrandKey is taken from the Brand table myclientid, myclientsecret are taken from OAUTH_CLIENT_DETAILS table
...