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

OIDC PR#2 --- organization login using OIDC #1309

Merged
merged 11 commits into from
Apr 11, 2024
Merged

OIDC PR#2 --- organization login using OIDC #1309

merged 11 commits into from
Apr 11, 2024

Conversation

ihsaan-ullah
Copy link
Collaborator

@ihsaan-ullah ihsaan-ullah commented Feb 7, 2024

@ mention of reviewers

@cjh1

A brief description of the purpose of the changes contained in this PR.

Now codabench admin can register organizations for OIDC authentication. Users can then use those organizations to login with their organization credentials

Issues this PR resolves

How to test

To test this PR, you need OIDC server.

OIDC_Server setup

  1. Unzip this OIDC_Server django app OIDC_Server.zip
  2. go to this directory
cd OIDC_Server
  1. build the docker image from the Dockerfile
docker build -t oidc .

Codabench

  1. Add the following to docker compose yaml file
  #-----------------------------------------------
  #   OIDC Server
  #-----------------------------------------------
  oidc:
    image: oidc
    command: bash -c "cd /app/ && python manage.py runserver 0.0.0.0:9100"  
    ports:
      - 9100:9100
    stdin_open: true
    tty: true
    logging:
      options:
        max-size: "20k"
        max-file: "10"
  1. Start codabench server
docker-compose up -d

OIDC client

  1. Open this URL in your browser
http://0.0.0.0:9100/
  1. Login using these credentials
username: ihsan
password: Ihsan123
Screenshot 2024-03-17 at 12 41 48 AM
  1. Open admin interface
http://0.0.0.0:9100/admin/
Screenshot 2024-03-17 at 12 42 43 AM
  1. Create a client by adding the following details
  • Name: Paris-Saclay
  • Response types: code(Authentication Code Flow)
  • Redirect URIs: http://localhost/oidc/complete/1/

Once you click save, you will be able to get client ID and client Secret

Codabench

  1. Open admin interface
http://localhost/admin/
  1. Create a new Auth Organization in Auth_organizations
Screenshot 2024-03-17 at 12 47 59 AM Input the following information (use the client id and client secret from previous step) Screenshot 2024-03-17 at 12 49 30 AM
  1. Now open login page:
http://localhost/accounts/login/

You will see Login with Pari-Saclay button. Accept terms and conditions and click the button to authenticate with Paris-Saclay server.

  1. Reset password
    reset your password and then login using both OIDC login and regular login

Checklist

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • CircleCi tests are passing
  • Ready to merge

@ihsaan-ullah ihsaan-ullah mentioned this pull request Feb 7, 2024
5 tasks
@Didayolo Didayolo linked an issue Mar 12, 2024 that may be closed by this pull request
5 tasks
@ihsaan-ullah
Copy link
Collaborator Author

@Didayolo, @bbearce this is now ready for review

@bbearce bbearce self-assigned this Mar 17, 2024
@bbearce
Copy link
Collaborator

bbearce commented Mar 17, 2024

I have it all setup but it's not quite working. Review:

Uploading oidc_comment_1_summary.png…

@bbearce
Copy link
Collaborator

bbearce commented Mar 17, 2024

I have it all setup but it's not quite working. Review:

@ihsaan-ullah
Copy link
Collaborator Author

@bbearce
Copy link
Collaborator

bbearce commented Mar 17, 2024

Sorry, my mistake

URLs should be :

These worked:
image

image

image

image

image

  • Now that it works, I should review the code at a minimum to double check it.
  • Also, I have mostly tested it works from my end and now I need to "understand it"

@ihsaan-ullah
Copy link
Collaborator Author

The terms and condtiions check seems problematic (when you have more than one organization). Besides this I think all should be ok. Please put review comments anywhere you want me to explain something in the code.

Please note that the OIDC_Server app is not part of the feature. All the links and details you have got from that app will be provided by the organization that wants to enable this feature.

@ihsaan-ullah
Copy link
Collaborator Author

Now you should see only one checkbox for all the organization buttons
Screenshot 2024-03-31 at 9 36 51 PM

@bbearce you may want to do a final test

@Didayolo Didayolo merged commit df26ec2 into develop Apr 11, 2024
1 check passed
@Didayolo Didayolo deleted the oidc_2 branch April 11, 2024 14:21
This was referenced Apr 11, 2024
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.

[New Feature] OIDC
3 participants