Giter Club home page Giter Club logo

connect-nodejs's People

Contributors

adalinesimonian avatar bauglir avatar bmeriaux avatar camfou avatar christiansmith avatar dmitrizagidulin avatar tomkersten avatar

Stargazers

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

Watchers

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

connect-nodejs's Issues

No access token after .token()

In my application I do the following

client.token({code: 'aabbcc'})
  .then(function(){
    client.register({})
  })
.catch(...)

The token sent to the register endpoint is Bearer undefined because in the client->register function the token is got like this:

var token = this.tokens && this.tokens.access_token

but this.tokens is undefined. Am I doing something wrong?

.well-known/openid-configuration

Hi,

are there any plans to support the .well-known/openid-configuration endpoint of a openid connect server? It should simplify setup somewhat.

Regards,
Daníel

Verifying access token scopes

I've run into an issue in a few instances where an access token is not being verified by AccessToken.verify and the "Insufficient scope" error is being thrown, it's coming from this line:

https://github.com/anvilresearch/connect-nodejs/blob/master/lib/AccessToken.js#L160

I wonder if this check is too restrictive, e.g if an access token has the scope:

"openid email profile phone"

And the Anvil Connect instance is configured with the scope:

"openid profile phone email"

Equally if an access token has any additional scopes the verification will also fail.

Is this by design? Should the scope verification match the exact string, or could we explode the scopes string into components and check that the JWT scopes match on a per-scope basis? Or maybe I'm missing something about this scope verification check entirely?

Happy to provide a patch for this but wanted to check up on the motivation for this design beforehand.

AccessToken.decode doesn't exist

Been looking around in the code as to what is generating the following error:
Access Token verify with verifiable JWT and mismatching audience should provide an error description

I can't find any mention of the AccessToken.decode function

I wouldn't mind taking a crack at it if you can tell me a little about what exactly it is supposed to return.

Missing method for changing user's password

I try to use updateUser for changing user's password, but it don't work.
Workaround is adding changePassword method into
https://github.com/anvilresearch/connect-nodejs/blob/master/rest/users.js

something like this

function changePassword (id, password, options) {
  options = options || {}
  options.url = '/v1/users/' + id + '/password'
  options.method = 'PATCH'
  options.json = {password: password}
  return request.bind(this)(options)
}
exports.changePassword = changePassword

Please add it into some future release

anvil.tokens is undefined

You may want to add in something like:
self.tokens = tokens in connect-nodejs/index.js
to your token function (starts around line 260)

Currently the userinfo function is trying to access anvil.tokens which does not exist.
(This is using the example code from the README)

Implement signout() helper function

Implement signout() function that hits the OIDC provider's /signout API endpoint, and passes along the required params:

  • id_token_hint (the ID Token of the signed in user)
  • post_logout_redirect_uri (must be one of the pre-registered post-logout redirect urls)

Implement client.loadClientCredentials()

In order to use much of the Anvil-specific API (say to create users), the nodejs client needs an access token.
From talking with @christiansmith, it sounds like that token comes from one of two places:

  1. A user's access token (received in the request). (Note to self: ask what sort of privileges the user must have in order to make this work? Some sort of admin role?)
  2. A client’s access token obtained from the token endpoint with client_credentials grant (works like an API key).

In the context of client.users.create(), there isn't a user yet, so no access token is possible from that source. Which means, the client should be able to load that client access token. So:

Implement client.loadClientCredentials():

  • assumes prior client registration and a call to .initProvider() to load endpoints etc.
  • makes a POST request to the provider's /token endpoint, w client_id + client_secret.
  • params in the body: grant_type=client_credentials

For reference:

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.