angularJS login connect to API backend -


i've found alot of text explaining haven't quite found i'm looking for. i'm hoping can point me in right direction. building angular app communicates ror back-end. on back-end there basic authentication username , password. moment i've hardcoded username , password app.js. i'm using restangular set so:

 var authenticationtoken = btoa('username,password');  .config(function (restangularprovider) {   restangularprovider.setdefaultheaders({authorization: 'basic ' + authenticationtoken}); } 

but users have login when open app username , password. app can use send requests backend. have no real idea how set properly.

update figured out problem. i'm using default headers, while should using individual headers. can set in service call.

all need create text input in angular. follow example in angular documentation. in controller/directive (whatever scope store username , password) make authentication call did in question.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -