Comments (12)
@x0rzkov
auth
module partly supports JWT authentication:
Line 43 in 11d4c97
You can wrap SessionStorer
with decorator to extend behaviour of Update
method
Line 54 in 11d4c97
To make set "Authorization" header in response
from auth.
hi @x0rzkov
Do you want to integrate JWT with QOR Admin resources? Or your own handler but with QOR Auth?
from auth.
Both is it possible ?
But in priority, I want to create an api endpoint with a bearer and allow users to get it with their login credentials (I use auth_themes/clean); not admin users.
So if "Or your own handler but with QOR Auth?" means that so the answer is that.
Btw, it is my second handle of @x0rzkov
Cheers
from auth.
Both are possible. but integrate JWT into QOR Admin is not an easy job.
Since you're in rush. better to do something with the Auth.
type Auth interface {
GetCurrentUser(*Context) qor.CurrentUser
LoginURL(*Context) string
LogoutURL(*Context) string
}
A quick patch would be inserting the jwt logic into GetCurrentUser
. I'm not 100% sure it would work but worth a try.
from auth.
Do you have a snippet to share ? plz
I found that integrating jwt:
- https://github.com/cryptix/ssb-pubmon/blob/master/config/config.go#L86
- https://github.com/cryptix/ssb-pubmon/blob/master/config/auth/auth.go
- https://github.com/imagepit/go-micro-user/blob/master/main.go
from auth.
I don't have a snippet. just an idea. e.g.
func (AdminAuth) GetCurrentUser(c *admin.Context) qor.CurrentUser {
// this is a normal implementation. You can try embed JWT logic here, if user passes the jwt check, return a proper user. otherwise return nil?
currentUser := Auth.GetCurrentUser(c.Request)
if currentUser != nil {
qorCurrentUser, ok := currentUser.(qor.CurrentUser)
if !ok {
fmt.Printf("User %#v haven't implement qor.CurrentUser interface\n", currentUser)
}
return qorCurrentUser
}
return nil
}
from auth.
@sergolius thanks for your reply :-)
Is there a way to create login controller without the form to get it and/or refresh it ?
Cheers,
X
from auth.
@x0rzkov QOR is very flexible, it's up to you to extend or override functionality.
See Password provider as base example: https://github.com/qor/auth/blob/11d4c974507d28e2fd10ff94edcdd00369e069a6/providers/password/password.go
from auth.
Unfortunately, I am lost on this one, do not know how to do it... If you have a snippet, you would be my saviour ^^
from auth.
Line 27 in 2bfb79d
from auth.
I send pull request to auth package.
from auth.
@lutfuahmet do you have an example with the full implementation mate ? Thanks for you reply also, greatly appreciated :-)
from auth.
Related Issues (20)
- Registration email not working HOT 2
- 'Unknow column...' error HOT 6
- Compilation errors while trying to run sample application in README.md HOT 7
- Password with Registration Fails HOT 7
- 授权这个模块,太难理解和使用 HOT 2
- 更新版本登录失败 HOT 1
- Client/Server auth
- Any two factor (2fa) feature on the horizon?
- views not working HOT 6
- any API documentation ? HOT 1
- google auth not working HOT 2
- Undefined config & models when Initializing Auth HOT 2
- How to use /login directly, set urlPrefix as "/" does not work
- Why no CORS implementation? Should we manually overwrite the Loginhandler and RegisterHandler?
- learning video
- Single sign on implementation in qor
- go-github implementation error
- Is this project alive? HOT 1
- Accidental sorry HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auth.