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

Django social account sso #5059

Merged
merged 18 commits into from
Jan 18, 2023
Merged

Conversation

ddx-day
Copy link
Contributor

@ddx-day ddx-day commented Oct 7, 2022

Issue: #1217

Currently there are a few proposals for SSO authentication to bypass the current user/password login on the UI. By using Django social accounts it is also possible to use SSO on the API, retrieving the security token by passing the code from the OAuth2 workflow. This is an example using Amazon Cognito, but any other social account could also be added.

Motivation and context

Currently CVAT has no functionality to log in with SSO. Other current proposals bypass the current Django framework to add SSO in the UI only, but still use username and password for the API. Using Django social accounts integrates SSO with the API as well, allowing it to be used as an alternative to the username and password, but can also be used together with other SSO frameworks that are UI only.

How has this been tested?

Unit tests for SSO manager in cvat-core and integration test with cvat-sdk for /auth/cognito endpoint.

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@nmanovic
Copy link
Contributor

nmanovic commented Oct 7, 2022

@ddx-day , thanks for the contribution! We are working on the improving authentication flow right now. You contribution is on time. Please give us some time to review your code. It can take a while because we just investigating how we want to add it. There are many possibilities.

Are you from a company which uses CVAT internally? I would love to meet and collaborate.

@ddx-day
Copy link
Contributor Author

ddx-day commented Oct 7, 2022 via email

Copy link
Contributor Author

@ddx-day ddx-day left a comment

Choose a reason for hiding this comment

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

Looks like the change to allow email to be used for login happened when this merge happened and that removing the setting actually breaks that change. I am testing it locally and I think I can just revert to the original 'user_email' setting

@nmanovic nmanovic added the auth Authentication or authorization functionality label Jan 10, 2023
@Marishka17 Marishka17 changed the title Django social account sso [WIP] Django social account sso Jan 14, 2023
@Marishka17 Marishka17 changed the title [WIP] Django social account sso [Do not merge] Django social account sso Jan 16, 2023
@Marishka17
Copy link
Contributor

@nmanovic, PR is ready.

@Marishka17 Marishka17 changed the title [Do not merge] Django social account sso Django social account sso Jan 16, 2023
Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

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

LGTM

@nmanovic nmanovic merged commit 0f0913c into cvat-ai:develop Jan 18, 2023
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Jul 1, 2023
Issue: cvat-ai#1217

Currently there are a few proposals for SSO authentication to bypass the
current user/password login on the UI. By using Django social accounts
it is also possible to use SSO on the API, retrieving the security token
by passing the code from the OAuth2 workflow. This is an example using
Amazon Cognito, but any other social account could also be added.

### Motivation and context
Currently CVAT has no functionality to log in with SSO. Other current
proposals bypass the current Django framework to add SSO in the UI only,
but still use username and password for the API. Using Django social
accounts integrates SSO with the API as well, allowing it to be used as
an alternative to the username and password, but can also be used
together with other SSO frameworks that are UI only.

### How has this been tested?
Unit tests for SSO manager in cvat-core and integration test with
cvat-sdk for /auth/cognito endpoint.

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable by a reason then ~~explicitly
strikethrough~~ the whole
line. If you don't do that github will show an incorrect process for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
- [ ] I have added a description of my changes into
[CHANGELOG](https://github.com/cvat-ai/cvat/blob/develop/CHANGELOG.md)
file
- [x] I have updated the [documentation](
https://github.com/cvat-ai/cvat/blob/develop/README.md#documentation)
accordingly
- [x] I have added tests to cover my changes
- [x] I have linked related issues ([read github docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))
- [ ] I have increased versions of npm packages if it is necessary
([cvat-canvas](https://github.com/cvat-ai/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/cvat-ai/cvat/tree/develop/cvat-core#versioning),
[cvat-data](https://github.com/cvat-ai/cvat/tree/develop/cvat-data#versioning)
and
[cvat-ui](https://github.com/cvat-ai/cvat/tree/develop/cvat-ui#versioning))

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/cvat-ai/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.

Co-authored-by: Melanie Day <mday@EYEDIAGNOSIS.local>
Co-authored-by: Maria Khrustaleva <maria@cvat.ai>
Co-authored-by: Nikita Manovich <nikita@cvat.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Authentication or authorization functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants