Dependency to execution of mix phx.gen.auth
Hi ... I am a newbie and have problems integrating your openid_connect lib (feature) to a small existing app.
So i have to Run mix phx.gen.auth [..] previously to get it work ?
i now get an error in a request of GET /auth/google (regarding your example code)
[error] ** (UndefinedFunctionError) function Routes.auth_url/2 is undefined (module Routes is not available)
Hello Tobias, sounds like you're using an older version of Phoenix and referencing the older style of using Routes vs the newer ~p
https://hexdocs.pm/phoenix/Phoenix.VerifiedRoutes.html#sigil_p/2 Phoenix.VerifiedRoutes — Phoenix v1.7.21
With that being said, this doesn't seem like an issue with the library. We are happy to help, but in order to do so, help us help you. If you can provide a link to your code or more context, that would be helpful.
hi Davydog and thank for your answer. This is used inside this Repos "Full Example" Code
It that sample code meant to run out of this single file for a first test ?? to have a first success.
Hi again. I had a look with this sigil syntax. But i really stuck. I mean, nice documentation for elixir. BUT how to convert the line above with this stupid :callback I have no idea how to write it....
Hello @tobiasdroessler, I will fix the example, but I suggest you read the Phoenix documentation as a starting point. You can also pick up a book like https://pragprog.com/titles/liveview/programming-phoenix-liveview/ Programming Phoenix LiveView: Interactive Elixir Web Programming Without Writing Any JavaScript by Bruce A. Tate and Sophie DeBenedetto
I will do my best to update this soon, but please use the forums and community chats for getting started type help.
Also, there is no relationship between this library and phx.gen.auth
thanks for providing information and your plan to fix/update this example. (y)
Is this example file meant to run alone as a first step ? OR is it a assembly of the changes in that 2..3 files mentioned in comment line above ?
It is simply a reference, not a complete example
Refer to the documentation for how to use this library
@davydog187 Is there a public /open Source project using your lib where is just can have a look at how to integrate ?? Please share me that link if existing. may i Could also afterwards adjust your example file
@tobiasdroessler I'm not aware of OSS projects that use this library. I've only provided some recent maintenance.
And very welcome maintenance 😄
@tobiasdroessler there isn't one I'm aware of. Is there something specific you're trying to implement?
I just wanna add OpenID Connect Auth. to an existing app. Thats all. But I am a newbie in elixir and Phoenix.. and it seems there are breaking changes (in elixir /phoenix) and your example does not compile/run . Quite hard for me to handle, because I am new and have no experience fixing this and that error.
Are you trying to use openid_connect with phx.gen.auth? If so the two weren't really meant to work out of the box with one another. That being said, perhaps it makes sense to make openid_connect play nicer with phx.gen.auth
That is not the case... I first tried without phx.gen.Auth ... but it was not compiling. see openid_connect issue .
This :redirect_if_authenticated was not defined .. after issuing phx.gen.Auth there was something like this defined. not sure why... may there was also some kind of liveview added. This issue was not cleared, I do not know what to add there or map ... no idea.