Skip to content

Further integration between oAuth 2.0 and LoopBack #817

Closed

Description

@raymondfeng
  1. Unify the access token model between oAuth 2.0 and User.login
  2. Integrate scope with ACL

Activity

  1. self-assigned this
    on Nov 14, 2014
  2. jkernech commented on Nov 26, 2014

    @jkernech

    +1

  3. XinV commented on Dec 4, 2014

    @XinV

    +1

  4. gagan-bansal commented on Jan 15, 2015

    @gagan-bansal

    +1

  5. robotiko commented on Feb 16, 2015

    @robotiko

    +1

  6. zetflo commented on Mar 5, 2015

    @zetflo

    +1

  7. raymondfeng commented on Mar 5, 2015

    @raymondfeng
    MemberAuthor

    I did some basic testing. The oAuth 2.0 token based authentication is already working with ACLs if you enable the middleware on your resource/api server that serves the model endpoints.

  8. archana09 commented on Mar 12, 2015

    @archana09

    Hi raymondfeng ,
    My scenario is using 'ClientCredentials' grant type to be able to generate accesstoken based on Client id and Client secret as we don't have any resource owner conept. Here are steps that I have done so fat:

    1. Created my own application model which extends Application model
    2. Registered my client application into application model from which I got Client Id and Client secret(restapikey)

    Here are my questions and can you please direct me (code base) on how to achieve this

    1. I need to pass this clientid and Client secret to 'ClientCredentials' grant type to get accesstoken from authorization server, right?
    2. Based on accesstoken if my client tries to access restapi how does ACL know which user he is being looged in? as my accesstoken does not have userid
  9. skyserpent commented on Apr 10, 2015

    @skyserpent

    +1

  10. XinV commented on Apr 11, 2015

    @XinV

    +1, some code examples and instruction walking through would be much helpful.

  11. SkyBone42 commented on May 4, 2015

    @SkyBone42

    +1

  12. danielrvt commented on May 25, 2015

    @danielrvt

    +1

  13. luksch commented on May 27, 2015

    @luksch

    +1 this would be awesome! Thanks for all the effort that goes into this.

  14. mercuriete commented on May 27, 2015

    @mercuriete

    +1
    I am working on an application that need throttling and autentication to get access to my api.
    I need information because maybe i missunderstood the concept. If I create ACL and roles in the api server, the gateway doent know anything about this users and this roles.
    the access_token is only to pass through the proxy and if you need an access_token to this end point its not the same.

    By the way, i want to know if there are any chance to autenticate with oauth2 as an anonymous user, because in our use case makes sense to keep some state or session to a gest that doesnt have account yet.

    I need to get working my application quickly so by the moment i am deleting all the gateway stuff and implement the autentication directly in the api server.

    Thank you for your job because is a great framework to create apis really quick but some features are not yet ready to be in production.

  15. asanchezdelc commented on Jun 3, 2015

    @asanchezdelc

    Hey guys, I was able to get a working example with oAuth2, passport, and ACL.

    https://github.com/qbanguy/loopback-gateway2

  16. Overdrivr commented on Jul 20, 2016

    @Overdrivr

    The oAuth 2.0 token based authentication is already working with ACLs if you enable the middleware on your resource/api server that serves the model endpoints

    @raymondfeng Which middleware are you referring to ?

    Does this mean that we can store OAuth tokens directly inside LB's AccessToken model, using node api equivalent of POST /User/{id}/accessTokens ? And still benefit from entire loopback ACL system ? That would be ideal

  17. JonnyBGod commented on Dec 13, 2016

    @JonnyBGod
    Contributor

    Is this still in the pipeline or is it better to create our own solution?

  18. AlexDM0 commented on Mar 21, 2017

    @AlexDM0

    I've added an option for oauth2 and loopback to live side by side. If you're interested, it's all available:
    https://github.com/crownstone/loopback-component-oauth2

  19. Yaty commented on Dec 12, 2017

    @Yaty

    Any update ? I can't use OAuth2 at all with those ACL issues :(

  20. Overdrivr commented on Dec 15, 2017

    @Overdrivr

    The approach I would use is similar to what Gitlab does, use OAuth2 for first connection to acquire user email, then let the user generate a password. It's not exactly the full OAuth2 flow, but at least in the end you can create a regular User with Loopback, and benefit from ACL/Authentication/etc.

    Eventually, if you need interaction with the OAuth provider, then you might be able to store credentials/token/whatever inside the Loopback User and pass those credentials to the OAuth provider when you need to.

    I haven't completely tested this approach so I might be missing something here, but my guess is this should work.

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