Closed jesusvazquez closed 3 years ago
Also please note I've disabled https://github.com/jesusvazquez/authboss-gin-sample/blob/147762e50b558e31eccd340c59e271b5d02093f8/main.go#L74-L77
// ab.Config.Storage.SessionState = sessionStore
// ab.Config.Storage.CookieState = cookieStore
Because when I enable those I get panics:
Hey @aarondl could you take a look? I'm a bit stuck and perhaps you'll be able to guide me. With a quick review if you have any idea just let me know and I'll work it out.
Hello @jesusvazquez. I'm quite busy with many projects which is why I didn't respond to this issue originally. I'm uninterested in spending any time supporting gin-gonic
and as such integration in left as an exercise for people who know and love gin-gonic
.
I'll mention a few things that may help you:
ab.Config.Storage.SessionState
is an absolute no-no. Nothing works without session storage in terms of Auth. See the documentation for requirements for each module.Good luck!
@jesusvazquez https://github.com/niaiwomattt/authboss-db-gorm-sample I implemented a simple data store, do you see it useful?
@niaiwomattt 现在我在旅游, 过几天我再看, 谢谢
(I'm off for a couple of days, I'll take a look when I come back, thank you)
@niaiwomattt, your implementation is like mine in MongoDB. Thanks, it helped me implement my own.
Hello!
First of all, thanks for authboss, it is a very promising project and I can feel the effort you've made all over the code.
I've done a bit of search on how to integrate authboss and gin-gonic in this repository and I've found https://github.com/volatiletech/authboss/issues/193 https://github.com/volatiletech/authboss/issues/157 and this wiki integration with gin gonic however I didn't manage to do it just yet. @aarondl made up clear that the goal of this repository is not to maintain compatibility but to maintain enough abstraction to work on any stack.
Gin together with gorilla, httprouter and chi are ones of the most common http servers out there for golang and I believe that we could work on some good examples for their users. https://github.com/volatiletech/authboss-sample is such a great example of
authboss
features but it only shows how to do it withchi
. You'd have to guess how to do it with other libraries.So thats what I'm going to do, I'm going to guess a way to do it until it finally works and then I'll contribute with some docs or examples. But for that I need a hand, I'm not very experienced and been struggling with this for a couple of hours already :)
Check this out https://github.com/jesusvazquez/authboss-gin-sample
From this output we can see that authboss its instantiating the routes although
auth
is not loaded.Now first requests:
Any ideas?
Thank you