Coder Social home page Coder Social logo

Comments (3)

danschultzer avatar danschultzer commented on August 18, 2024

It's because it's passed along as param, since some strategies (like client credentials) must not permit refresh token.

There should be tests for it in all strategies, e.g. here's for the code flow strategy (this was some of the earliest code I wrote in elixir so not very idiomatic if refute is_nil):

test "#grant/2 returns access token", %{resource_owner: resource_owner, application: application, access_grant: access_grant} do
assert {:ok, body} = Token.grant(@valid_request, otp_app: :ex_oauth2_provider)
access_token = QueryHelpers.get_latest_inserted(OauthAccessToken)
assert body.access_token == access_token.token
assert access_token.resource_owner_id == resource_owner.id
assert access_token.application_id == application.id
assert access_token.scopes == access_grant.scopes
assert access_token.expires_in == Config.access_token_expires_in(otp_app: :ex_oauth2_provider)
refute is_nil(access_token.refresh_token)
end

from ex_oauth2_provider.

blatyo avatar blatyo commented on August 18, 2024

I see. We were creating access tokens directly from AccessTokens.create_token/3, because we're migrating users from one system into another specifically for auth. So, it was surprising to us when we noticed we didn't have refresh tokens, but had configured it.

from ex_oauth2_provider.

danschultzer avatar danschultzer commented on August 18, 2024

Yeah, it's confusing. I should had called it something different in the db than what it's called in the config. I mostly just ported it straight from doorkeeper.

from ex_oauth2_provider.

Related Issues (20)

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.