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

Auto-Login to CKAN (but only if the user belongs to ckan-admin group in Keycloak) #1

Merged
merged 4 commits into from
Dec 21, 2023

Conversation

sergeygurvich
Copy link
Collaborator

@sergeygurvich sergeygurvich commented Dec 18, 2023

Three main test/use cases:

  1. CKAN Admin
    a. User goes to the front-end and logs in as CKAN authorized user
    b. User clicks Catalog
    Result: User will be logged into the CKAN. (not as system admin, but as a user that can create new org, dataset etc)

  2. CKAN non-admin
    a. User goes to the front-end and logs in as NOT CKAN authorized user
    b. User clicks Catalog
    Result: User will not be logged into the CKAN

  3. Not logged in
    a. User goes to the front-end (without login)
    b. User clicks Catalog
    Result: User will not be logged into the CKAN

server_url = tk.config.get('ckanext.keycloak.server_url', environ.get('CKANEXT__KEYCLOAK__SERVER_URL'))
client_id = tk.config.get('ckanext.keycloak.client_id', environ.get('CKANEXT__KEYCLOAK__CLIENT_ID'))
realm_name = tk.config.get('ckanext.keycloak.realm_name', environ.get('CKANEXT__KEYCLOAK__REALM_NAME'))
redirect_uri = tk.config.get('ckanext.keycloak.redirect_uri', environ.get('CKANEXT__KEYCLOAK__REDIRECT_URI'))
client_secret_key = tk.config.get('ckanext.keycloak.client_secret_key', environ.get('CKANEXT__KEYCLOAK__CLIENT_SECRET_KEY'))
client_secret_key = tk.config.get('ckanext.keycloak.client_secret_key',
environ.get('CKANEXT__KEYCLOAK__CLIENT_SECRET_KEY'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not picking up the values from the .ini file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I'm not sure, may be it does

@sergeygurvich sergeygurvich merged commit 718e387 into ndp Dec 21, 2023
@sergeygurvich sergeygurvich deleted the feature-auto_login branch December 21, 2023 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants