Giter VIP home page Giter VIP logo

angular-basic-auth's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

angular-basic-auth's Issues

Base64 encoding of userid and password is not correct

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

Can you make a new release from the sources?

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!

Clear authorization header fails on Safari

$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.

[feature] Login/logout without GET/POST

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.

Update README

It's quite outdated: for example, the header generation example still uses the wrong format encode():encode().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.