LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph-sdkauthtypesStudioUser
    Class●Since v0.1

    StudioUser

    Copy
    StudioUser(
        self,
        username: str,
        is_authenticated: bool = False,
    )

    Constructors

    Attributes

    View source on GitHub
    constructor
    __init__
    NameType
    usernamestr
    is_authenticatedbool
    attribute
    username: username
    attribute
    is_authenticated: bool
    attribute
    display_name: str
    attribute
    identity: str
    attribute
    permissions: Sequence[str]

    A user object that's populated from authenticated requests from the LangGraph studio.

    Note: Studio auth can be disabled in your langgraph.json config.

    {
      "auth": {
        "disable_studio_auth": true
      }
    }

    You can use isinstance checks in your authorization handlers (@auth.on) to control access specifically for developers accessing the instance from the LangGraph Studio UI.

    Examples

    Use @auth.on to deny by default, but allow Studio users through:

    @auth.on
    async def deny_all_except_studio(ctx: Auth.types.AuthContext, value: Any) -> bool:
        # Allow Studio users, deny everyone else by default
        if isinstance(ctx.user, Auth.types.StudioUser):
            return True
        return False
    
    # Then add specific handlers to allow access for non-Studio users
    @auth.on.threads
    async def allow_thread_access(ctx: Auth.types.AuthContext, value: Any) -> Auth.types.FilterType:
        return {"owner": ctx.user.identity}