Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of this gem with Client Credentials flow #12

Open
periflo opened this issue Oct 23, 2019 · 4 comments
Open

Use of this gem with Client Credentials flow #12

periflo opened this issue Oct 23, 2019 · 4 comments

Comments

@periflo
Copy link

periflo commented Oct 23, 2019

We're using Grape with Grape::OAuth2 for a Rails project which provides an API that needs to be secured by the Client Credentials flow of OAuth2.

We've been following the configuration guidelines and the 'lazy' usage example stated in the README, but we have a question regarding the resource_owner_class_name. As we are using Client Credentials we don't need a resource owner, but the documentation states that all three models must exist. We don't know if we could abstain from creating that model or if we should do something else.

We didn't include the resource owner parts in our migrations either.

Thanks for your time.

@nbulaj
Copy link
Member

nbulaj commented Oct 24, 2019

Hi @periflo90 . First of all I need to know if you are using existing gems mixins (ActiveRecord / Sequel, Mongoid?). If yes, then as far as I remember AccessToken and AccessGrant mixins has associations on resource_owner_class_name , so it must be present.

But you can just implement your own classes for tokens and just ignore resource_owner_class_name as it would be called only in corresponding OAuth flow.

@periflo
Copy link
Author

periflo commented Oct 25, 2019

Hello @nbulaj, thanks for your reply.

Yes, we are using ActiveRecord mixins.

@nbulaj
Copy link
Member

nbulaj commented Oct 29, 2019

Then I can recommend to "copy" the behavior of this mixins but without association to resource owner if you don't need it

@periflo
Copy link
Author

periflo commented Oct 31, 2019

Will do. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants