Skip to content

growthquantix/upstox-auth-pro-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Upstox Auth Pro (Java)

Upstox Auth Pro is a high-performance Java library designed to automate the Upstox API login flow. It handles Headless Login, 2FA (TOTP) generation, and Authorization Code capture entirely through code.

✨ Features

  • 🕵️ Stealth Automation: Uses Playwright for Java with built-in headers to bypass bot detection.
  • 🔐 Integrated TOTP: Automatically generates 2FA codes using Aerogear OTP.
  • 📦 Persistent Storage: Built-in FileStorage using Jackson for JSON serialization.
  • 🛠️ Fluent API: Clean Builder pattern for easy configuration.

📦 Installation (Maven)

Add this to your pom.xml:

<dependency>
    <groupId>com.upstox.auth</groupId>
    <artifactId>upstox-auth-pro</artifactId>
    <version>0.1.0</version>
</dependency>

🚀 Quick Start

import com.upstox.auth.UpstoxAuthenticator;
import com.upstox.auth.storage.FileStorage;

public class Main {
    public static void main(String[] args) {
        UpstoxAuthenticator auth = new UpstoxAuthenticator.Builder()
            .apiKey("YOUR_API_KEY")
            .apiSecret("YOUR_API_SECRET")
            .redirectUri("https://your-redirect-url.com")
            .mobileNo("9876543210")
            .pin("123456")
            .totpKey("YOUR_TOTP_KEY")
            .storage(new FileStorage("upstox_token.json"))
            .headless(true)
            .build();

        // This will check storage first, and only automate login if needed
        String accessToken = auth.getAccessToken();
        System.out.println("Valid Access Token: " + accessToken);
    }
}

🔐 Getting Your Credentials

Please refer to the Upstox Developer Portal to get your API Key and Secret. For the TOTP Key, check your Upstox Security settings under 2FA.

⚖️ License

Distributed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages