semvec/pypi-packages huggingface dataset:
reflex-okta-auth 0.2.1
Integration with Okta server-side SSO
Requires Python: <4.0,>=3.10
Keywords: python, reflex, reflex-enterprise

# reflex-okta-auth

This package requires the `reflex_enterprise` package to be installed.

## Installation

```bash
pip install reflex-okta-auth
```

## Usage

### Set Up Okta Application

Create a new Application and set up a .env file with the following variables:

```env
OKTA_CLIENT_ID=your_client_id
OKTA_CLIENT_SECRET=your_client_secret
OKTA_ISSUER_URI=your oauth issuer uri
```

Reflex will need to access these variables to authenticate users.

### Register Auth Callback

```python
from reflex_enterprise import App
from reflex_okta_auth import register_auth_endpoints

...

app = App()
register_auth_endpoints(app)
```

### Check `OktaAuthState.userinfo` for user identity/validity

```python
import reflex as rx
from reflex_okta_auth import OktaAuthState

@rx.page()
def index():
    return rx.container(
        rx.vstack(
            rx.heading("Okta Auth Demo"),
            rx.cond(
                rx.State.is_hydrated,
                rx.cond(
                    OktaAuthState.userinfo,
                    rx.vstack(
                        rx.text(f"Welcome, {OktaAuthState.userinfo["name"]}!"),
                        rx.text(OktaAuthState.userinfo.to_string()),
                        rx.button("Logout", on_click=OktaAuthState.redirect_to_logout),
                    ),
                    rx.button("Log In with Okta", on_click=OktaAuthState.redirect_to_login),
                ),
                rx.spinner(),
            ),
        ),
    )
```

### Validate the Tokens

Before performing privileged backend operations, it is important to validate the
tokens to ensure they have not been tampered with. Use
`OktaAuthState._validate_tokens()` helper method to validate the tokens.
solarman-opendata-test 0.0.2
Asynchronous Python API for Solarman devices
Requires Python: >=3.12
Keywords: solarman, iot, home automation

# Solarman

Python client for interacting with Solarman devices over local network.

## Installation

```bash
pip install solarman-opendata
```

## Usage

### Basic Example

```python
import asyncio
import aiohttp

from solarman_opendata.solarman import Solarman

async def main():
    host = "190.160.3.43"
    port = 8080

    async with aiohttp.ClientSession() as session:
        client = Solarman(
            session=session,
            host=host,
            port=port
        )

        data = await client.fetch_data()
        print(data)

if __name__ == "__main__":
    asyncio.run(main())
```

## Contributing

Contributions are welcome! Please open an issue or submit a pull request.