🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@d11/dream-auth-login-provider

Package Overview
Dependencies
Maintainers
6
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@d11/dream-auth-login-provider

Provides authentication utilities for integrating user login through the Dream11 SDK.

latest
Source
npmnpm
Version
0.2.4
Version published
Weekly downloads
152
4.11%
Maintainers
6
Weekly downloads
 
Created
Source

DreamAuth Login Provider

A React Native library that provides seamless authentication login functionality for Dream11 applications. This library handles OAuth flows, session management, and deep linking for secure user authentication.

Features

  • OAuth Authentication Flow - Complete OAuth 2.0 implementation for Dream11 authentication
  • WebView Integration - Secure web-based login flow with custom WebView implementation
  • Deep Link Handling - Automatic deep link processing for authentication callbacks
  • Cross-Platform - Full support for both iOS and Android platforms
  • Session Management - Robust session handling with refresh token support
  • Security - Secure token storage and transmission
  • Turbo Module - Built with React Native's new architecture for optimal performance

Installation

npm install @d11/dream-auth-login-provider
yarn add @d11/dream-auth-login-provider

iOS Setup

  • Install pods:
cd ios && pod install
  • Add URL scheme to your Info.plist:
	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>CFBundleURLName</key>
			<string>com.dream11.app</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>dream11</string>
			</array>
		</dict>
	</array>
  • Handle deep links in your AppDelegate.swift:
import DreamAuthLoginProvider 

  func application(_ application: UIApplication, handleOpen url: URL) -> Bool { 
    if url.scheme == "dream11" {
      DreamAuthLoginProviderInitializer.handleRedirect(
        uri: url.absoluteString, refreshToken: nil,
        baseUrl: "https://auth.dream11.com", providerApp: "dream11")
      return true
    }

    return RCTLinkingManager.application(application, open: url, options: [:])
  }

Android Setup

  • Add deep link handling to your AndroidManifest.xml:
<activity>
  <intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="dream11" />
  </intent-filter>
</activity>
  • Handle deep links in your MainActivity.kt:

import com.dreamauthloginprovider.DreamAuthLoginProviderInitializer

override fun onNewIntent(intent: Intent?) {
  super.onNewIntent(intent)
  intent?.data?.let { uri ->
    if (uri.scheme == "dream11") {
       DreamAuthLoginProviderInitializer.handleRedirect(
        context = this,
        uri = uri.toString(),
        refreshToken = "",
        baseUrl = ""

      )
    }
  }
}

Authentication Flow Overview

  • Deep Link Reception: The library intercepts deep links with the dream11 scheme
  • Session Initialization: Parses authentication parameters and initializes session
  • WebView Launch: Opens a secure WebView for user authentication
  • Session Verification: Verifies the authentication session with the server
  • Consent Handling: Manages user consent for data sharing
  • Redirect Completion: Redirects back to the host application with authentication results

Authentication States

The library handles various authentication states:

  • LOGGED_IN - User successfully authenticated
  • CONSENT_NOT_PROVIDED - User denied consent
  • LOGIN_DISMISSED - User cancelled the login flow
  • SOMETHING_WENT_WRONG - An error occurred during authentication

Architecture

The library is built with a modular architecture supports both React Native architecture:

Core Components

  • Configuration: Session management and initialization
  • WebView Flow: Secure web-based authentication
  • Deep Link Handling: URL scheme processing and routing
  • Verification Flow: Session verification and consent handling
  • HTTP Client: Network communication with authentication servers
  • Client Details: Client application configuration management

Platform-Specific Implementation

  • iOS: Swift-based implementation with UIKit integration
  • Android: Kotlin-based implementation with Android Activities
  • React Native: TypeScript bridge for cross-platform functionality

Development

Setup

  • Clone the repository:
git clone https://github.com/dream11/dream-auth-login-provider.git
cd dream-auth-login-provider
  • Install dependencies:
yarn
  • Run the example app:
# Start Metro bundler
yarn example start

# Run on iOS
yarn example ios

# Run on Android
yarn example android

Available Scripts

  • yarn typecheck - TypeScript type checking
  • yarn lint - ESLint linting
  • yarn test - Run unit tests
  • yarn clean - Clean build artifacts
  • yarn prepare - Build the library
  • yarn release - Release new version

Security

  • All network communications use HTTPS
  • Tokens are securely stored and transmitted
  • WebView implementation prevents unauthorized access
  • Session validation ensures authentication integrity

Contributing

We welcome contributions! Please see our Contributing Guide for details on:

  • Development workflow
  • Code style and linting
  • Testing requirements
  • Pull request process
  • Commit message conventions

License

MIT License - see LICENSE file for details.

Support

For support and questions:

  • Create an issue on GitHub
  • Contact the development team
  • Check the example app for usage patterns

Made with ❤️ by the Dream11 team

Keywords

react-native

FAQs

Package last updated on 05 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts