danschultzer / phoenix_oauth2_provider

Get an OAuth 2 provider running in your phoenix with controllers, views and models in just two minutes
MIT License
84 stars 41 forks source link

Encountering below error when setup oauth2 #6

Closed suhaschitade closed 6 years ago

suhaschitade commented 6 years ago

Hi, Setup was perfect however when I tried to create an application for oauth2. I encountered below error

UndefinedFunctionError at POST /oauth/applications function nil.schema/1 is undefined or private

These are the extra debug information _csrf_token "VQIbcx8BVwALPjtwMiw0YwYUczt6JgAAg4X5GY/93LCDyUb9kV1m2Q==" _utf8 "✓" oauth_application %{"name" => "appointo", "redirect_uri" => "urn:ietf:wg:oauth:2.0:oob", "scopes" => ""}

Please let me know if I miss anything Regards,

danschultzer commented 6 years ago

Sounds like you haven’t set a resource owner schema: https://github.com/danschultzer/phoenix_oauth2_provider/blob/master/README.md#resource-owner-schema

PhoenixOauth2Provider expects you to have some form of user ecto schema to tie the authentications to. Often this module would just be called User.

suhaschitade commented 6 years ago

Thank you for your help. This has been resolved, however I came across with new issue. Even after setting correct resource schema, it results in an error. New issue has been raised.

Regards