Coder Social home page Coder Social logo

0xmatt / ngx-oauth-client Goto Github PK

View Code? Open in Web Editor NEW
39.0 39.0 9.0 581 KB

An Angular4+ compatible OAuth2.0 compliant HTTP wrapper.

Home Page: https://0xMatt.github.io/ngx-oauth-client

License: MIT License

TypeScript 82.46% JavaScript 17.54%
angular http http-client ng2 ng4 ng5 oauth oauth2-client

ngx-oauth-client's People

Contributors

0xmatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ngx-oauth-client's Issues

different hosts for auth and data

Hello, as discussed on a different issue (link), I would like to be able to have different hosts based on the functionality or data to access.
This means that the host param in the configuration api should be able to handle

  • an url for auth (ie, auth.server.com/oauth),
  • and another one (or more) for data after authentication (ie, data.server.com/v1).

As pointed out in the other issue the approach to extend and override should work in theory but as you said "this functionality will be removed", and I don't understand this statement.
I would like to know how much this is gonna last if I follow this path as you suggested.

I know this scenario could be not so common, but I'll give it a shot with your library before writing something from scratch.

As regards the implementation, as far as I can tell, the easiest way could be to add an optional parameter to the configuration api that stores 1 or more data hosts (all in the same network, sharing the auth token). What's behind the scene is a total mistery up to now, but I'll eventually dig into your code soon.

Thanks a lot in advance!

Multiple params for .get

Having an issue with passing an object into .get. Only the last property in the passed in object is being used. ie .get('posts', {limit: 10, offset: 10}) builds the url /posts?offset=10 and will disregard all other properties.

Params are not able to be set on non get methods

As the title states, NgxRequest.setParams is only called if the request method is GET. All other methods need to be able to make use of this if a params key is set, however it will need to comply with the style that the HttpClient options uses, so it can't take object that we convert, but an instance of HttpParams itself. It's late, this is just a reminder to fix this tomorrow.

Override headers not working

Hello, I'm trying to add auth header to my request, but it seems it gets lost at this point (ngx-request.js):

NgxRequest.prototype.setHeaders = function (headers, override) {
        this.headers = new http_1.HttpHeaders(Object.assign(headers, override));
        return this;
};

headers param is correctly populated with
Object {Authorization: "Bearer 2f8e3907-93c5-4cd1-a81b-554d4811a675"},
and override param is undefined.
The problem is at the point when the script create the new http_1.HttpHeaders object.

The returned object has:

HttpHeaders {normalizedNames: Map(0), lazyUpdate: null, lazyInit: }

Any hint? Thanks in advance!

OAuth with basic authentication

Hello,
I am trying to get this working with OAuth and basic authentication.
So the client should be able to send a basic auth header in the token request, if I am correct this isn't implemented yet?
Can you confirm? If it's implemented, any example how to do this?

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.