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

Document the STS flow #7639

Merged
merged 7 commits into from
Apr 11, 2024
Merged

Document the STS flow #7639

merged 7 commits into from
Apr 11, 2024

Conversation

guy-har
Copy link
Contributor

@guy-har guy-har commented Apr 8, 2024

No description provided.

@guy-har guy-har requested a review from Isan-Rivkin April 8, 2024 10:44
Copy link

github-actions bot commented Apr 8, 2024

No linked issues found. Please add the corresponding issues in the pull request description.
Use GitHub automation to close the issue when a PR is merged

Copy link

github-actions bot commented Apr 8, 2024

♻️ PR Preview c877af6 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

Copy link

github-actions bot commented Apr 8, 2024

E2E Test Results - DynamoDB Local - Local Block Adapter

13 passed


# STS Login

Secure Token Service (STS) authentication in lakeFS allows users to authenticate via an Identity Provider (IdP), using a secure and efficient method.
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
Secure Token Service (STS) authentication in lakeFS allows users to authenticate via an Identity Provider (IdP), using a secure and efficient method.
Secure Token Service (STS) authentication in lakeFS allows users to authenticate via an Identity Provider (IdP), using OIDC Authentication workflow.

Comment on lines 17 to 19
{: .note}
> The architecture does include the steps to generate the code using the remote authenticator. this should be done prior to the STS login flow.
> There is a sample implementation to generate the code, redirect_uri and state at the end of this document.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is more relevant as a stand alone section "pre-requisite"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What would you suggest?

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding a pre-requisite section or a title in that same section explaining you must have access to an OIDC provider and literally that text.
just making it more clear what is expected

docs/reference/security/sts-login.md Outdated Show resolved Hide resolved
docs/reference/security/sts-login.md Show resolved Hide resolved
@guy-har guy-har requested a review from Isan-Rivkin April 9, 2024 15:00
@guy-har guy-har added exclude-changelog PR description should not be included in next release changelog minor-change Used for PRs that don't require issue attached labels Apr 9, 2024
@guy-har guy-har requested review from ozkatz and talSofer April 9, 2024 15:21
@guy-har guy-har marked this pull request as ready for review April 9, 2024 15:22
docs/reference/security/sts-login.md Outdated Show resolved Hide resolved
docs/reference/security/sts-login.md Outdated Show resolved Hide resolved
Secure Token Service (STS) authentication in lakeFS allows users to authenticate via an Identity Provider (IdP), using OIDC Authentication workflow.
This document outlines the process, from setting up the STS authentication flow to integrating with lakeFS through the [high-level Python SDK](../../integrations/python.md).

## Architecture
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT about moving the architecture section to the end of the page? this way we start with the "how to" and whoever is more interested in the details can continue reading

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about before the Sample implementation?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good!

## Architecture

{: .note}
> The architecture does include the steps to generate the code using the remote authenticator. this should be done prior to the STS login flow.
Copy link
Contributor

Choose a reason for hiding this comment

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

The architecture does include the steps to generate the code using the remote authenticator.

The context for this sentence is not clear, can you please explain what was the intent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed, PTAL

Comment on lines 47 to 50
- lakeFS Client: Initiates the authentication process by providing IdP credentials.
- lakeFS Server: Facilitates the authentication request between the client and the remote authenticator.
- Remote Authenticator: Acts as a bridge between lakeFS and the IdP, handling credential validation.
- IdP (Identity Provider): Validates the provided credentials and returns the authentication status.
Copy link
Contributor

Choose a reason for hiding this comment

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

great section, thanks!


## Configuration

To enable STS authentication, configure your lakeFS instance with the appropriate endpoint to the external Authentication Service.
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
To enable STS authentication, configure your lakeFS instance with the appropriate endpoint to the external Authentication Service.
To enable STS authentication, configure your lakeFS instance with the endpoint of the external Authentication Service.



## Sample implementation to generate the code, redirect_uri and state
The following code snippet demonstrates how to generate the code, redirect_uri and state values that are required to initiate a new client session using the STS login feature.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit; missing whitespace

Ensure you replace <url-to-remote-authenticator-endpoint> with the actual URL of your Authentication Service.


## STS Login with high level python client
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO the order of actions a user needs to take is not 100% clear.
Can you create a numbered list of steps for configuration to a successful login?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like a good idea, I'm not really sure how to do that, Add a previous section with steps and links?
One concern I do have with the steps is that (I'm assuming) the user configuring and the user using the log in with the high level python client are not the same user, also the configuration is a one time thing and the login is not, @talSofer WDYT? is it even a concern?

Copy link
Contributor

Choose a reason for hiding this comment

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

One concern I do have with the steps is that (I'm assuming) the user configuring and the user using the log in with the high level python client are not the same user

that's a good point.

If we keep Configuration separate from Usage, how many steps there are before you can run the Python snippet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only the steps for generating the code and state which is up to the client to configure in the way they want. so basically there are three separate independent (almost) steps

  • configuration
  • generating the code and state - which is up to the client but we have provided a sample code of how to do that
  • generate client with the python wrapper (two lines of code)


```python
import lakefs
myclient = lakefs.client.from_web_identity(code = '', redirect_uri = '', state = '' , ttl_seconds = 7200)
Copy link
Contributor

Choose a reason for hiding this comment

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

empty strings are confusing here; I should use what I get from the remote authenticator, right?

Copy link
Contributor Author

@guy-har guy-har Apr 10, 2024

Choose a reason for hiding this comment

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

No, from the Identity provider. changing

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks :)

```


## Sample implementation to generate the code, redirect_uri and state
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to include sample code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it makes it more obvious what exactly I need to provide and it gives the user something to play with
This example is provided for auth0 but with a slight change it will work for other providers as well (I verified it on entra as well)

guy-har and others added 2 commits April 10, 2024 16:24
Co-authored-by: talSofer <tal.sofer@treeverse.io>
@guy-har
Copy link
Contributor Author

guy-har commented Apr 10, 2024

@talSofer changed and commented PTAL 🙏

Co-authored-by: talSofer <tal.sofer@treeverse.io>
docs/reference/security/sts-login.md Outdated Show resolved Hide resolved

## STS Login with high level python client

The Python client simplifies initiating a client session with STS login. Use the following example to start a new session:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe can change this sentence to highlight that the high-level Python client is THE way to do STS login ?


{: .note}
> The architecture documentation begins at the stage following the generation of the code by the remote authenticator.
> Please be aware that the preliminary steps, including the code generation process that takes place between the user and their identity provider, are not included in this documentation.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that we should include this step in this guide. even if not with specific instructions. the goal is to understand when I need to take every step.
maybe this should be step 1 in sts login? WDYT?

## Architecture

{: .note}
> The architecture documentation begins at the stage following the generation of the code by the remote authenticator.
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
> The architecture documentation begins at the stage following the generation of the code by the remote authenticator.
> The architecture documentation begins at the stage after the generation of the code by the remote authenticator.

> STS Login is available in lakeFS Cloud and lakeFS Enterprise. currently only tested on lakeFS Enterprise.

Secure Token Service (STS) authentication in lakeFS enables users to authenticate to lakeFS using temporary credentials obtained from an Identity Provider (IdP) via the OpenID Connect (OIDC) Authentication workflow..
This document outlines the process, from setting up the STS authentication flow to using temporary credentials to interact with lakeFS through the [high-level Python SDK](../../integrations/python.md).
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
This document outlines the process, from setting up the STS authentication flow to using temporary credentials to interact with lakeFS through the [high-level Python SDK](../../integrations/python.md).
This document outlines the process, from enabling STS authentication to using temporary credentials to interact with lakeFS through the [high-level Python SDK](../../integrations/python.md).

guy-har and others added 2 commits April 11, 2024 10:46
Co-authored-by: talSofer <tal.sofer@treeverse.io>
@guy-har guy-har requested a review from talSofer April 11, 2024 08:17
Copy link
Contributor

@talSofer talSofer left a comment

Choose a reason for hiding this comment

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

Looks good, Thank you!

@guy-har guy-har merged commit 0bd9aa9 into master Apr 11, 2024
37 checks passed
@guy-har guy-har deleted the docs/sts-login branch April 11, 2024 10:31
emulatorchen pushed a commit to emulatorchen/lakeFS that referenced this pull request May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude-changelog PR description should not be included in next release changelog minor-change Used for PRs that don't require issue attached
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants