Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/acheong08/OpenAIAuth

Reverse engineered Auth0 for OpenAI
https://github.com/acheong08/OpenAIAuth

Last synced: about 2 months ago
JSON representation

Reverse engineered Auth0 for OpenAI

Awesome Lists containing this project

README

        

# OpenAIAuth
Fetch access tokens for chat.openai.com

## Python version
```py
from OpenAIAuth import Auth0
auth = Auth0(email_address="[email protected]", password="example_password")
access_token = auth.get_access_token()
```

## Go version
```go
package main

import (
"fmt"
"os"

"github.com/acheong08/OpenAIAuth/auth"
)

func main() {
auth := auth.NewAuthenticator(os.Getenv("OPENAI_EMAIL"), os.Getenv("OPENAI_PASSWORD"), os.Getenv("PROXY"))
err := auth.Begin()
if err.Error != nil {
println("Error: " + err.Details)
println("Location: " + err.Location)
println("Status code: " + fmt.Sprint(err.StatusCode))
println("Embedded error: " + err.Error.Error())
return
}
token, err := auth.GetAccessToken()
if err.Error != nil {
println("Error: " + err.Details)
println("Location: " + err.Location)
println("Status code: " + fmt.Sprint(err.StatusCode))
println("Embedded error: " + err.Error.Error())
return
}
fmt.Println(token)
}
```

## Credits
- @linweiyuan
- @rawandahmad698
- @pengzhile