Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Client credentials returns incorrect expires_in time #535

Open

Description

@mdeggies

Making a request to my local express server's /oauth/token endpoint always returns an access token TTL of 3600, regardless of my Application's access token TTL settings.

This

curl -X POST --user $ACCOUNT_ID:$ACCOUNT_SECRET http://localhost:3000/oauth/token -d grant_type=client_credentials

returns

{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2WFU5UzhLU0hHR1lTVVlZNVRaNTNVWkJIIiwiaXNzIjoiaHR0cHM6Ly9hcGkuc3Rvcm1wYXRoLmNvbS92.....","token_type":"bearer","expires_in":3600,"scope":""}

Making the same request to the https://api.stormpath.com/v1/applications/$APP_ID/oauth/token?grant_type=client_credentials&client_id=$USER_ID&client_secret=$USER_SECRET results in the correct expires_in time.

Activity

  1. changed the title [-]Client credentials returns incorrect access token TTL[/-] [+]Client credentials returns incorrect expires_in time[/+] on Oct 6, 2016
  2. robertjd commented on Oct 6, 2016

    @robertjd
    Member

    This library isn't (yet) using our REST API to create tokens for the client_credentials workflow. The underlying Node SDK will have this implemented in the next release (it's in master now), at which point we will need to refactor this library to use the Node SDK for this work flow.

    The area to change is here:

    https://github.com/stormpath/express-stormpath/blob/master/lib/controllers/get-token.js#L112

    We can probably remove that block, and just have the client_credentials case be handled by the OAuthAuthenticator in the previous block.

  3. self-assigned this
    on Nov 14, 2016
  4. removed their assignment
    on Nov 14, 2016
  5. robertjd commented on Nov 15, 2016

    @robertjd
    Member

    @typerandom this can be worked on, just link to master of the Node SDK. The upcoming release 0.19.0 will have the needed changes, as well as the new scope factory which is currently being reviewed here:

    stormpath/stormpath-sdk-node#558

    For convenience we should provide a way for the developer to pass a scope factory when initializing express-stormpath, so that express developers can also make use of this new scope factory feature.

  6. nbryan commented on Jan 6, 2017

    @nbryan

    Any updates on this? I've leveled-up to stormpath 0.19.0 and express-stormpath 3.1.8 and it doesn't seem to be resolved yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions