djangoflow_auth_discord 0.1.0+6 copy "djangoflow_auth_discord: ^0.1.0+6" to clipboard
djangoflow_auth_discord: ^0.1.0+6 copied to clipboard

djangoflow_auth_discord brings the power of Discord authentication to your Flutter app!

DjangoFlow Auth Google Package Logo

🌟 DjangoFlow Auth Discord Flutter Package 🌟

GitHub Repository Pub Package

djangoflow_auth_discord brings the power of Discord authentication to your Flutter app! Seamlessly integrate Discord login functionalities into the DjangoFlow framework. Enjoy custom OAuth2 configuration, web and mobile support, and a consistent API through the DiscordSocialLoginProvider class. It's time to level up your app with Discord login! 🔒🎮

Empower your users with the convenience of Discord login using djangoflow_auth_discord, and provide a seamless authentication experience in your app.

🚀 Features 🚀

  • Effortless integration with the DjangoFlow framework.
  • Discord login using the OAuth2 protocol using Implicit Grant Flow.
  • Customizable OAuth2 configuration for advanced scenarios.
  • Full support for both web and mobile(Android & iOS) platforms.
  • Consistent and easy-to-use API through the DiscordSocialLoginProvider class.

📦 Installation 📦

Add the djangoflow_auth_discord package to your pubspec.yaml file:

dependencies:
  djangoflow_auth: <latest_version>
  djangoflow_auth_discord: <latest_version>
  oauth2_client: <latest_version> # Check for the latest version

Run flutter pub get to fetch the package.

Note: Follow oauth2_client package for platform related configuration.

For Web Only: For web configuration, to receive callback your redirectUri should point to an html file from your web application. The html file should contain this html code. For example you can put/create this html file in your flutter_project/web/auth.html

<!DOCTYPE html>
<title>Authentication complete</title>
<p>
  Authentication is complete. If this does not happen automatically, please
  close the window.
  <script>
    window.opener.postMessage(
      {
        type: "callback",
        url: window.location.href,
      },
      "*"
    );
  </script>
</p>

🔧 Usage 🔧

To use the DiscordSocialLoginProvider for Discord authentication, follow these steps:

  1. Import the necessary packages:
import 'package:djangoflow_auth/djangoflow_auth.dart';
import 'package:djangoflow_auth_discord/djangoflow_auth_discord.dart';
import 'package:flutter/foundation.dart';
  1. Initialize DiscordSocialLoginProvider with your OAuth2 configuration:
final discordLogin = DiscordSocialLoginProvider(
  oAuth2Configuration: OAuth2Configuration(
    clientId: 'YOUR_CLIENT_ID',
    redirectUri: 'YOUR_REDIRECT_URI',
    customUriScheme: 'YOUR_CUSTOM_SCHEME',
    state: 'OPTIONAL_STATE',
    scope: 'SCOPE_STRING',
  ),
  type: SocialLoginType.fromProvider(ProviderEnum.discord),
);
  1. Perform the Discord login:
final token = await discordLogin.login();

// Handle the login result, e.g., extract the access token
if (token != null) {
  // Proceed with authentication or user data retrieval
} else {
  // Handle login failure
}

Read more here for a detailed example on how to use it with djangoflow_auth: https://pub.dev/packages/djangoflow_auth#setting-up-authcubit

🌟 Example 🌟

Example

👏 Contributions and Issues 👏

Contributions, bug reports, and feature requests are welcome! Feel free to submit a pull request or open an issue on the GitHub repository.

🛠 Troubleshooting 🛠

📄 License 📄

This package is distributed under the MIT License.

0
likes
130
pub points
38%
popularity

Publisher

verified publisherapexive.com

djangoflow_auth_discord brings the power of Discord authentication to your Flutter app!

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

djangoflow_auth, flutter, http, oauth2_client

More

Packages that depend on djangoflow_auth_discord