Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simpler options than OAuth/OpenID for login #497

Open
luto opened this issue Jun 8, 2017 · 17 comments
Open

simpler options than OAuth/OpenID for login #497

luto opened this issue Jun 8, 2017 · 17 comments

Comments

@luto
Copy link
Contributor

luto commented Jun 8, 2017

It's clear to see that using the FAS is perfect to handle logins on https://release-monitoring.org/. Most of the people using that instance are fedora people anyway. For self hosted instances this introduces an external dependency. Acquiring the necessary tokens also makes the setup more complicated than it needs to be.

Do you plan on enabling a simple login process with local users, either from the database or alternatively using just a text file? Would you consider a PR to add this?

@jeremycline
Copy link
Member

I'm open having local users, although we also have adding GitHub OAuth (#485) and fixing Google OAuth (#437) on the roadmap. At the moment, what's in master authentication-wise is somewhat different than https://release-monitoring.org/ has, and needs a but more work before it's release-ready (#485 (comment)), so it might be a turbulent time to also add local users. On the other hand, it might be worth considering it since we need to do some database modeling for users anyway.

@ncoghlan
Copy link
Contributor

ncoghlan commented Jun 23, 2017

I'd personally advise against adding local user authentication support directly to Anitya itself, since it would make Anitya responsible for secure password management and all the complexity that comes with that (password resets, etc). Any such code would also inevitably end up being under-tested, since release-monitoring.org wouldn't be using it.

However, it would be good to have a documented way of running a simple OAuth2 server up locally so folks can more readily use their own identity provider, rather than relying on a third party one like FAS.

Ipsilon generally expects to be run in combination with a full IdM server like FreeIPA, so it's probably too complex to be suitable for that usage model.

Instead, an approach that may make more sense might be to use the example auth server from flask-oauthlib: https://flask-oauthlib.readthedocs.io/en/latest/oauth2.html

Since Anitya is only relying on the authentication flows and handling role-based access control itself, the OAuth2 server it talks to doesn't need to provide the full feature set offered by something like Ipsilon or Keycloak.

@pypingou
Copy link
Member

Ipsilon generally expects to be run in combination with a full IdM server like FreeIPA, so it's probably too complex to be suitable for that usage model.

Well you can pick what Ipsilon relies on in the backend, it can be LDAP, with FreeIPA or not, but it can also be something much more simple such as system accounts (actual accounts on the server) or htpasswd used by apache or even a file with username/password. So you can make it as complex or as simple as you wish.

@ncoghlan
Copy link
Contributor

If there's a simple devel mode for Ipsilon (e.g. sqlite backed), than that would be ideal. However, if that's possible, it isn't clearly documented anywhere a Google search can find it.

@pypingou
Copy link
Member

@puiterwijk can likely give more info, but Ipsilon is really quite flexible on what it can do.

@odra
Copy link

odra commented Jan 22, 2019

I know this thread is a bit old, but is adding keycloak support and option?

@Zlopez
Copy link
Contributor

Zlopez commented Jan 22, 2019

We are already using python-social-auth, but I can look at the keycloak.

@odra
Copy link

odra commented Jan 22, 2019

Just a bit of context: I was looking into using this for an internal team so I kinda of needed to a custom/internal login mechanism which led me to ask about keycloak - it can be an alternative of providing custom login mechanisms without making anitya responsible for that kind of tech.

@Zlopez
Copy link
Contributor

Zlopez commented Jan 22, 2019

Look at the python-social-auth, maybe this will be enough for you.

@odra
Copy link

odra commented Jan 22, 2019

@Zlopez I can work in a PR if there is interest (I kind of need it anyway)

@Zlopez
Copy link
Contributor

Zlopez commented Jan 22, 2019

This is always welcomed. If you want to invest your time in this I will be glad to review it.

@odra
Copy link

odra commented Jan 23, 2019

Hello, I am getting this error in social auth (in the callback url):


psycopg2.ProgrammingError: relation "social_auth_usersocialauth" does not exist
--
  | LINE 2: FROM social_auth_usersocialauth

It seems that the social tables were not created, do you know if there is a way to force its creation?

@Zlopez
Copy link
Contributor

Zlopez commented Jan 23, 2019

Did you ran the alembic migrations?

I recommend to use Vagrant for development environment, it will do everything for you.

@odra
Copy link

odra commented Jan 23, 2019

Ah right, I didn't I just created the app and rolled with it :)

Will give it a try and post the results

@odra
Copy link

odra commented Jan 23, 2019

still got the same error - I am trying to deploy it on openshift (fresh installation) so I don't need to import the db data into posgre

I tried running the command and specifying the alembic.ini file path in the init function from the utilities module but it didn't change anything

@Zlopez
Copy link
Contributor

Zlopez commented Jan 23, 2019

If you are trying to deploy this on openshift you could actually look at our roles for deploying in fedora infrastructure. Unfortunately the DB is handled separately. But still you could look - https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/openshift-apps/release-monitoring?id=60f89dbe30a3ad24f7168d60f571d3658910b982

There should be actually some script for creating database - https://github.com/release-monitoring/anitya/blob/master/createdb.py

@odra
Copy link

odra commented Jan 23, 2019

I am using the createdb.py but it doesn't create the social tables :(

Thanks for the links, I will take a look at the openshift templates 👍

@Zlopez Zlopez added this to Nice to have in Maintenance mode Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Maintenance mode
  
Nice to have
Development

No branches or pull requests

6 participants