Comments (9)
I searched a bit through the available libraries. There are 2 gin-specific oauth libraries one based on the basic oauth lib and another one from zalando. But both are not updated in the last few years.
Another option would be to just use the basic oauth2 lib, that would also give some more freedom in handling the authentication, e.g. if you plan to make authentication mechanics switchable via config options.
from server.
I think the first option go-oauth2/gin-server
appears fine, it glues together Gin (which we are already using) and the basic oauth2 lib. Presumably the reason why it seems so inactive is that there's not a lot of code, but still the code that's there is convenient for us to use. Since it's from go-oauth2
, I would trust it more than some random package.
from server.
I implemented oauth as an optional authentication mechanism in a branch of my fork.
I would enjoy any comments and ideas on how to improve it further. Currently the only thing I am missing (and want to implemented) is the ability to create longterm tokens.
I intentionally tried to apply a modular scheme to the authentication process, so that other authentication methods can easily be implemented if needed.
from server.
Are there any standards and/or golang libraries you prefere for this? As I want to look into the actual implementation of such auth a little bit.
from server.
Hm, I think this depends on the goals we want to achieve:
- If we want to aim for a web-based UI, then we need to setup a login page where login data is posted to and verified, respond with a session cookie and keep track of user sessions.
- If the CLI is in focus instead, OAuth access tokens would be interesting: the login page returns a token (with limited lifetime), which is stored by pbcli and added to the Authorization header for any request it makes.
Personally, I'd prefer sticking to the CLI because it is less work to maintain, but happy to receive input on this.
from server.
OAuth sounds fine for me. It is a widely adopted standard so it can be used for a GUI later too. Maybe an option for longterm (limitied access) tokens might be great too.
from server.
That's awesome! Would you mind creating a pull request for it? We can treat it as WIP, but it makes the review more convenient.
from server.
Sure created #29
from server.
Thanks, will have a look on Tuesday!
from server.
Related Issues (20)
- Add message formatting options HOT 2
- Add "delete" option for messages HOT 3
- API HOT 6
- Better API documentation HOT 9
- Evaluate Semgrep as SAST HOT 1
- Provide Docker image tags other than 'latest' HOT 3
- Provide binary release
- Use more advanced logging framework HOT 3
- Provide examples for sending notifications in different languages HOT 1
- Add compatability with alertmanager webhooks HOT 2
- no content/title with element-ios HOT 10
- Latest Docker image is broken HOT 3
- Support configuration of trusted proxies
- Support direct configuration of HTTPS HOT 1
- Simpler API endpoint HOT 2
- Topic is changed after container restart HOT 10
- Include PushBits CLI in Docker image HOT 3
- Create an SBOM file
- `/_matrix/client/v3/createRoom: M_UNKNOWN (HTTP 400): Invalid user_id` HOT 4
- Request failed at creating new application HOT 6
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 server.