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

Update documentation for social authentication with Amazon Cognito #8557

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Marishka17
Copy link
Contributor

@Marishka17 Marishka17 commented Oct 17, 2024

Motivation and context

Added more details on how to configure Amazon Cognito pool

How has this been tested?

Checklist

  • I submit my changes into the develop branch
    - [ ] I have created a changelog fragment
  • I have updated the documentation accordingly
    - [ ] I have added tests to cover my changes
    - [ ] I have linked related issues (see GitHub docs)
    - [ ] I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

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.

Summary by CodeRabbit

  • Documentation
    • Updated the "Social auth configuration" document to clarify instructions for enabling social authentication for Enterprise clients.
    • Expanded benefits section to highlight convenience, time-saving, and security of using social credentials.
    • Restructured Amazon Cognito setup process into a detailed two-step guide with visual aids.
    • Standardized formatting for Google and GitHub authentication sections for consistency.

Copy link
Contributor

coderabbitai bot commented Oct 17, 2024

Walkthrough

The document "Social auth configuration" has been updated to clarify the process of enabling social authentication for Enterprise clients in a Self-Hosted solution. Key changes include an introductory note about client eligibility, an expanded section on the benefits of social authentication, and a restructured two-step process for configuring Amazon Cognito. This includes detailed instructions for creating a user pool and setting up an auth_config.yml file. The sections for Google and GitHub authentication have been standardized for formatting consistency, enhancing the overall organization of the document.

Changes

File Path Change Summary
site/content/en/docs/enterprise/social-accounts-configuration.md - Added note indicating feature availability for Enterprise clients.
- Expanded benefits of social authentication.
- Restructured Amazon Cognito setup into a detailed two-step process.
- Standardized formatting for Google and GitHub sections.
- Improved overall document organization.

Poem

🐰 In the garden of code, we hop with glee,
Social auth blooms, as bright as can be!
With Cognito's steps, clear as the day,
Enterprise friends can join in the play.
So let’s share our joys, with each login cheer,
For security and ease, we hold dear! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
site/content/en/docs/enterprise/social-accounts-configuration.md (2)

Line range hint 1-22: Excellent additions to the introductory section!

The new note about Enterprise client availability and the expanded benefits of social authentication provide valuable context for users. This improvement helps set clear expectations and highlights the advantages of the feature.

Consider adding a brief sentence or two about the security measures implemented by social auth providers to reinforce the security benefit mentioned.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~126-~126: Possible missing comma found.
Context: ...-1.amazoncognito.com`). Copy this domain as you'll need it later when configurin...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~146-~146: Possible missing comma found.
Context: ...etcould be found on the page with app details while thedomain` value could be...

(AI_HYDRA_LEO_MISSING_COMMA)


Line range hint 102-155: Excellent improvements to the Amazon Cognito authentication section!

The expanded and restructured content provides a much more comprehensive guide for setting up Amazon Cognito authentication. The addition of detailed steps and references to visual aids significantly enhances the user experience and clarity of the instructions.

Consider the following minor improvements:

  1. Line 118: Change "Configure a new app on the step Integrate your app:" to "Configure a new app in the Integrate your app step:"
  2. Line 126: Add a comma after "Copy this domain" for better readability.
  3. Line 137: The indentation of the YAML content seems off. Ensure consistent indentation throughout the YAML snippet.
  4. Line 146: Add a comma after "app details" for better readability.
  5. Line 151: There's a backtick (`) instead of a quotation mark (") at the end of the line. Replace it with a quotation mark.

These minor adjustments will further improve the overall quality and consistency of the documentation.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~126-~126: Possible missing comma found.
Context: ...-1.amazoncognito.com`). Copy this domain as you'll need it later when configurin...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~146-~146: Possible missing comma found.
Context: ...etcould be found on the page with app details while thedomain` value could be...

(AI_HYDRA_LEO_MISSING_COMMA)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ffe45fe and 0d6e439.

⛔ Files ignored due to path filters (3)
  • site/content/en/images/cognito_pool_1.png is excluded by !**/*.png
  • site/content/en/images/cognito_pool_2.png is excluded by !**/*.png
  • site/content/en/images/cognito_pool_3.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • site/content/en/docs/enterprise/social-accounts-configuration.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
site/content/en/docs/enterprise/social-accounts-configuration.md

[uncategorized] ~126-~126: Possible missing comma found.
Context: ...-1.amazoncognito.com`). Copy this domain as you'll need it later when configurin...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~146-~146: Possible missing comma found.
Context: ...etcould be found on the page with app details while thedomain` value could be...

(AI_HYDRA_LEO_MISSING_COMMA)

🔇 Additional comments (3)
site/content/en/docs/enterprise/social-accounts-configuration.md (3)

Line range hint 24-61: Google authentication section looks good!

The instructions for setting up Google authentication remain clear and comprehensive. The minor formatting improvements enhance readability and maintain consistency with other sections.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~126-~126: Possible missing comma found.
Context: ...-1.amazoncognito.com`). Copy this domain as you'll need it later when configurin...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~146-~146: Possible missing comma found.
Context: ...etcould be found on the page with app details while thedomain` value could be...

(AI_HYDRA_LEO_MISSING_COMMA)


Line range hint 63-100: GitHub authentication section is well-maintained!

The instructions for setting up GitHub authentication remain clear and comprehensive. The minor formatting improvements enhance readability and maintain consistency with other sections.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~126-~126: Possible missing comma found.
Context: ...-1.amazoncognito.com`). Copy this domain as you'll need it later when configurin...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~146-~146: Possible missing comma found.
Context: ...etcould be found on the page with app details while thedomain` value could be...

(AI_HYDRA_LEO_MISSING_COMMA)


Line range hint 157-161: Final command section is correct and consistent.

The docker compose command provided for running the setup remains unchanged and is consistent with the instructions in other sections. This ensures a uniform approach across different authentication methods.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~126-~126: Possible missing comma found.
Context: ...-1.amazoncognito.com`). Copy this domain as you'll need it later when configurin...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~146-~146: Possible missing comma found.
Context: ...etcould be found on the page with app details while thedomain` value could be...

(AI_HYDRA_LEO_MISSING_COMMA)

Copy link

sonarcloud bot commented Oct 17, 2024

3. Create conпiguration file in CVAT:

1. Create the `auth_config.yml` file with the following content:
## Enable Authentication with Amazon Cognito
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Enable Authentication with Amazon Cognito
## Enable authentication with Amazon Cognito

The other headings don't use title case.


- Configure a new app on the step `Integrate your app`:
- Select the `Confidential client` type, as CVAT securely stores
client secrets on the server side.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
client secrets on the server side.
client secrets on the server side.

- Configure a new app on the step `Integrate your app`:
- Select the `Confidential client` type, as CVAT securely stores
client secrets on the server side.
(_Note_: the `Public client` type is also supported.)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why add this note? CVAT is a confidential client, Cognito supports confidential clients... there's no reason to configure it as a public client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CVAT is a confidential client, Cognito supports confidential clients...

I know, but there was such a situation when the customer configured a public client instead of a confidential one. I decided to mention that, but okay, I'll delete this mention.


1. **Create and configure an [Amazon Cognito user pool](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html)**.
Follow these detailed steps to set up the user pool:
- Create a user pool. For example, you might use settings like those shown in the image below:
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to start in the middle. I would assume the first step would be "go to the AWS Management Console", then "click XXX to go to Cognito settings"...

Also, the steps should be in a numbered list, since they are sequential.

![](/images/cognito_pool_2.png)

- Once your pool is configured, go to the `App integration` tab
on the pool details page and then to the `Domain` section.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
on the pool details page and then to the `Domain` section.
on the pool details page and then to the `Domain` section.


To enable authentication with Amazon Cognito for your CVAT instance, you need to complete two main steps:

1. **Create and configure an [Amazon Cognito user pool](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html)**.
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this is really the right approach here.

I would assume a sizable fraction of users who want to configure authentication via Cognito already have a pool there. The whole point of Cognito is to share users between multiple apps, so unless you're only starting to set up SSO and CVAT happens to be your first app, you would already have a pool.

Given this, perhaps it would be better to focus this section on configuring an existing pool, and add an optional extra step in front that tells people to create a new pool if they don't have one.


- Once your pool is configured, go to the `App integration` tab
on the pool details page and then to the `Domain` section.
Create either a custom domain or Cognito domain (e.g., `https://cvat.auth.us-east-1.amazoncognito.com`).
Copy link
Contributor

Choose a reason for hiding this comment

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

cvat is probably not the best suggestion here, as a) we shouldn't assume the pool is just for CVAT (if it is, why use Cognito at all?), and b) the name has to be unique within the region, so different organizations would need to use different names. I would replace cvat with a placeholder like <my_org>. Or just stick with custom-cognito-prefix, like in the config below.

Comment on lines +160 to +161
# schema: http|https, CVAT_PORT is optional
export CVAT_BASE_URL="<SCHEMA>://${CVAT_HOST}:<CVAT_PORT>"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# schema: http|https, CVAT_PORT is optional
export CVAT_BASE_URL="<SCHEMA>://${CVAT_HOST}:<CVAT_PORT>"
# cvat_port is optional
export CVAT_BASE_URL="<http|https>://${CVAT_HOST}:<cvat_port>"

The other placeholders are lowercase, so cvat_port ought to be too.

Copy link
Contributor

Choose a reason for hiding this comment

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

"CVAT" would make more sense as the client name.

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