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

[WIP] Add OpenIDConnect Authentication #336

Closed

Conversation

aalexanderr
Copy link
Contributor

@aalexanderr aalexanderr commented Oct 4, 2021

This PR aims to add OIDC integration for scancode.io.

Why:
We want to run scancode.io on public address and would prefer to have the ability to give access to it only to the ONAP community.

I've asked question on weekly meeting if you guys are interested in OIDC integration for scancode.io (as we were adding it for our instance) and got response that yes, you are. I probably should've created an issue for it.

Commits currently pushed were authored by Mateusz Sobocinski (@matteuszs @msobocinsk) who just left our company thus I'll try to adjust this to be mergable. I'll squash the commits, add Mateusz's SoB & add docs regarding usage.

We have tested it with keycloak (there is new target in the makefile adding keycloak instance in docker but needs manual configuration for now, should I describe it here/automate it so it can be checked easily?)

The main question I have before removing WIP label is - should it be enabled by default?

@@ -108,7 +116,7 @@ sqlite:
@$(MAKE) migrate

run:
${MANAGE} runserver 8001
${MANAGE} runserver 0.0.0.0:8001
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should probably be reverted, i see no need to expose on all addresses

--env KEYCLOAK_PASSWORD=${KEYCLOAK_PASSWORD} \
--publish ${KEYCLOAK_HTTPS_BIND_PORT}:8443 \
jboss/keycloak
@echo "-> Keycloak launched. Please visit https://localhost:${KEYCLOAK_HTTPS_BIND_PORT} and configure realm"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -129,4 +137,21 @@ docs:
rm -rf docs/_build/
@${ACTIVATE} sphinx-build docs/ docs/_build/

keycloak:
@echo "-> Run Keycloak Identity provider"
docker run -dit --name scancodeio-keycloak \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My guess is that -it flags are not needed here

oidc:
@echo "-> Configure OIDC settings"
@echo "" >> ${ENV_FILE}
@echo OIDC_OP_REALM_ENDPOINT=\"https://keycloak:${KEYCLOAK_HTTPS_BIND_PORT}/auth/realms/${KEYCLOAK_REALM_NAME}/\" >> ${ENV_FILE}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add env for https://keycloak so it can be easily configured when having keycloak running on different domain

@tdruez
Copy link
Contributor

tdruez commented Oct 4, 2021

Could you provide some context and explanation about those changes?

@aalexanderr
Copy link
Contributor Author

Could you provide some context and explanation about those changes?

Added some context to the PR msg, let me know if I missed something and I'll be happy to write it down :)

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.

3 participants