xelita / angular-basic-auth Goto Github PK
View Code? Open in Web Editor NEWBasic authentication for AngularJS applications.
License: MIT License
Basic authentication for AngularJS applications.
License: MIT License
See, for example, here.
Hi,
I noticed that the base64 encoding in your module is not correct.
your code :
var authData = base64Service.encode(username) + ':' + base64Service.encode(password);
should be:
var authData = base64Service.encode(username + ':' + password);
After this change it worked very well, thank you!
Greetz,
Alfred
Hi,
A couple of months ago there was an improvement with the base64 encoding. But now your dist is out of sync with the sources.
Can you please build it again, so that if I do a bower install the base64 encoding is correct?
Thanx!
$http.defaults.headers.common.Authorization = basicAuthConstants.basicHeaderPrefix;
fails because it sets the header with "Basic
" (observe extra space). Safari doesn't like this.
See also here.
If you want, I can fork and fix it myself.
Use case: I have an API where I need to send a basic-auth header on every call, but I don't necessarily need to do a separate GET/POST to login/logout. In this case, it would be useful to have a function that sets the headers and one that clears them. Alternatively, one could check if url
is null
and skip the $http
call.
If you find that this feature makes sense, I can create a PR.
It's quite outdated: for example, the header generation example still uses the wrong format encode():encode()
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.