Skip to content

Enable Auth in AGS#5928

Merged
victordibia merged 24 commits intomainfrom
auth_infra_ags
Mar 14, 2025
Merged

Enable Auth in AGS#5928
victordibia merged 24 commits intomainfrom
auth_infra_ags

Conversation

@victordibia
Copy link
Copy Markdown
Contributor

@victordibia victordibia commented Mar 13, 2025

Why are these changes needed?

loginags.mov
image

Authentication

This PR implements an experimental authentication feature to enable personalized experiences (multiple users). Currently, only GitHub authentication is supported. You can extend the base authentication class to add support for other authentication methods.

By default authenticatio is disabled and only enabled when you pass in the --auth-config argument when running the application.

Enable GitHub Authentication

To enable GitHub authentication, create a auth.yaml file in your app directory:

type: github
jwt_secret: "your-secret-key"
token_expiry_minutes: 60
github:
  client_id: "your-github-client-id"
  client_secret: "your-github-client-secret"
  callback_url: "http://localhost:8081/api/auth/callback"
  scopes: ["user:email"]

Please see the documentation on GitHub OAuth for more details on obtaining the client_id and client_secret.

To pass in this configuration you can use the --auth-config argument when running the application:

autogenstudio ui --auth-config /path/to/auth.yaml

Or set the environment variable:

export AUTOGENSTUDIO_AUTH_CONFIG="/path/to/auth.yaml"
- Authentication is currently experimental and may change in future releases
- User data is stored in your configured database
- When enabled, all API endpoints require authentication except for the authentication endpoints
- WebSocket connections require the token to be passed as a query parameter (`?token=your-jwt-token`)

Related issue number

Closes #4350

Checks

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.76%. Comparing base (5f9e37d) to head (79d19bf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5928   +/-   ##
=======================================
  Coverage   75.76%   75.76%           
=======================================
  Files         191      191           
  Lines       13114    13114           
=======================================
  Hits         9936     9936           
  Misses       3178     3178           
Flag Coverage Δ
unittests 75.76% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

victordibia and others added 4 commits March 13, 2025 14:16
… cross-site scripting

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@gagb gagb self-requested a review March 14, 2025 18:11
@victordibia
Copy link
Copy Markdown
Contributor Author

@grawfin , tagging you here in the event this is useful to your implementation described here

@victordibia victordibia merged commit fe1feb3 into main Mar 14, 2025
57 checks passed
@victordibia victordibia deleted the auth_infra_ags branch March 14, 2025 22:02
@grawfin
Copy link
Copy Markdown

grawfin commented Mar 15, 2025

@victordibia that's fantastic, thanks for the follow up! I was going to start having a look at this topic soon but it seems you beat me to it :)

Thanks for taking care of that.

@victordibia victordibia added this to the 0.4.2-studio milestone Mar 16, 2025
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.

Add authentication infrastructure for AGS

3 participants