strongloop / loopback-component-oauth2

oAuth 2.0 server for LoopBack
http://www.strongloop.com
Other
62 stars 63 forks source link

How do I connect OAuthAccessToken model & the AccessToken model? #53

Closed talpasco closed 6 years ago

talpasco commented 7 years ago

I'm trying to set myself as a provider.

Decision step is working flawlessly. User is logging-in, and is getting a token & a refresh token.

I'm failing to understand how this is connected to the AccessToken model. When is the connection between the OAuthAccessToken model & the AccessToken model suppose to happen? What am I missing? How does the user supposed to get his accessToken, so he would have access to our API?

Thanks, Tal BTW, you guys at loopback rocks!!!

asgpha commented 7 years ago

What am I missing? How does the user supposed to get his accessToken, so he would have access to our API?

The callback url or redirect uri contains the API token. Once the user has been authenticated, loopback will redirect using the callback or redirect uri and append the token in the uri.

When is the connection between the OAuthAccessToken model & the AccessToken model suppose to happen?

  1. create a model call OAuthToken that extends to AccessToken

  2. add the following code in app.start

var options = { dataSource: app.dataSources.db, // Data source for oAuth2 metadata persistence resourceServer: true, }; oauth2.oAuth2Provider( app, // The app instance options // The options );

stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

UVk commented 7 years ago

This issue is important and should not be stale.

deviant32 commented 7 years ago

+1

OAuth Access Token is not being resolved by our API.. Please help.

stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 6 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.