A Dart client for FusionAuth, Flutter compatible

Overview

FusionAuth Dart Client semver 2.0.0 compliant

If you're integrating FusionAuth with a Dart or Flutter application, this library will speed up your development time.

For additional information and documentation on FusionAuth refer to https://fusionauth.io.

A library for FusionAuth Dart developers.


Known limitations

  • The use of some objects are limited due to missing support for dynamic fields (example: custom claims on a jwt). Currently, any data placed in JSON will not render in dart unless the class is explicitly subclassed to contain those fields.

Usage

A simple usage example:

import 'dart:convert';

import 'package:fusionauth_dart_client/fusionauth_dart_client.dart';

void main() async {
  var client = FusionAuthClient('bf69486b-4733-4470-a592-f1bfce7af580',
      'https://local.fusionauth.io', null);

  var response = await client.searchUsersByQuery(SearchRequest(
      search: UserSearchCriteria(queryString: "email:[email protected]")));

  if (response.successResponse != null) {
    print(json.encode(response.successResponse.users));
  }
}

pubspec.yaml:

dependencies:
  fusionauth_dart_client: ^1.21.0

Contributors

Questions and support

If you have a question or support issue regarding this client library, we'd love to hear from you.

If you have a paid edition with support included, please open a ticket in your account portal. Learn more about paid editions here.

Otherwise, please post your question in the community forum.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/FusionAuth/fusionauth-dart-client.

License

This code is available as open source under the terms of the Apache v2.0 License.

Comments
  • invalid_client

    invalid_client

    Hi there I just got this issue.

     result =
            await appAuth.authorizeAndExchangeCode(
              AuthorizationTokenRequest(
                FUSIONAUTH_CLIENTID,
                FUSIONAUTH_REDIRECT_URI,
    //            issuer: FUSIONAUTH_ISSUER,
                discoveryUrl: FUSIONAUTH_DISCOVERY_URL,
                scopes: <String>['openid', 'profile', 'offline_access'],
                // promptValues: ['login']
              ),
            );```
    
    I am getting thee error below
    ===================
    PlatformException(authorize_and_exchange_code_failed, Failed to authorize:[error: invalid_client, description: Client
    authentication missing aaas Basic Authorization header or credentials in the body(or some combination of them.], null, null)
    
    
    

    found the solution here https://fusionauth.io/community/forum/topic/428/social-login-with-flutter-app but I don't see that any issue has been filed.

    what problems can disabling require authentition give?

    opened by stellanhaglund 8
  • error in user registration

    error in user registration

    i have getting error in user registration api

    url = "https://fa.wajooba.xyz/api/user/registration"
    method = "POST"
    
    body : 
    {
        "registration": {
            "applicationId": "-original app id-"
        },
        "user": {
            "email": "--email--",
            "firstName": "hdhdhdhd",
            "lastName": "xbxgdgdgd",
            "password": "Test@1234"
        }
    }
    
    header :  
    X-FusionAuth-TenantId:--tenantid--
    Content-Type:application/json
    
    
    response : 
    {
        "fieldErrors": {
            "": [
                {
                    "code": "[invalidJSON]",
                    "message": "Invalid JSON in the request body. The property was []. The error was [Possible conversion error]. The detailed exception was [No content to map due to end-of-input\n at [Source: (org.apache.catalina.connector.CoyoteInputStream); line: 1, column: 0]]."
                }
            ]
        }
    }
    
    opened by JenishEmpiric 6
  • create new API from bash script

    create new API from bash script

    Hello @robotdan , I am a new user of fusion auth. I was trying the example shared on https://www.youtube.com/watch?v=xY_3Xnpqin8&ab_channel=FusionAuth but it was giving me the same "response". I am using the current version of the fusionauth and was making the example work on my local.

    Any thoughts?

    opened by kab1012 2
  • [130] Support for the Message Templates API

    [130] Support for the Message Templates API

    Related Issues

    Background

    This PR incorporates the client changes for the support of enhanced MFA functionality.

    Implementation Details

    • Adds new Message Template methods for interacting with the upcoming APIs, namely:
      • Supports PUT /api/message/template/{id}
      • Supports GET /api/message/template/{id}
      • Supports GET /api/message/template
      • Supports POST /api/message/template
      • Supports DELETE /api/message/template
      • Supports PATCH /api/message/template/{id}
      • Supports POST /api/message/template/preview
    • Adds new Domain objects and responses for the upcoming APIs, namely:
      • io.fusionauth.domain.api.MessageTemplateRequest
      • io.fusionauth.domain.api.MessageTemplateResponse
      • io.fusionauth.domain.api.PreviewMessageTemplateRequest
      • io.fusionauth.domain.api.PreviewMessageTemplateResponse
      • io.fusionauth.domain.message.MessageTemplate
      • io.fusionauth.domain.message.Message
    enhancement 
    opened by iveelsm 2
  • Fixes for various sb targets related to Dart and Go

    Fixes for various sb targets related to Dart and Go

    Sample fusionauth-pr body as create by a script:

    Related PRs in this update:

    Some context of whats going on here

    If we imagine there was a fusionauth-pr repo as part of the project then we could potentially script a command is pr create to create something like the above as a PR to fusionauth-pr with links to all the related PRs. This PR here in dart-client got accidentally created, so I'm using it as an example of how things might look. There is a limitation of the gh command line interface to github. You can pr create --body-file filename from a file (documented, but I have not tested it) and only edit with a pr edit --body "New body for PR". Which means (I think) you are limited in how big your edited body can be. So, you create all the PRs for the various main/code repos and collect all the links to the those PRs. Then, you create a PR in the fusionauth-pr repo with the body from a file that contains all the links (like the block above). And last, you loop back through and pr edit all the bodies with links back to the main fusionauth-pr PR. All that can be scripted. So, the last part would be for the dev to edit the body of the fusionauth-pr PR with more details about the update they are trying to push. For example the final body might look something like:

    Sample fusionauth-pr body as create/edited by the dev:

    This combined PR changes various things related to the Dart and Go clients:

    • In fusionauth-client-builder call sb format on the Dart and Go clients after building
    • Add setup target to go-client
    • In fusionauth-app add go-client to testClientLibraries list of libraries
    • In fusionauth-dart-client removes a newline (oops, can probably close/delete this PR 😬)

    Related PRs in this update:

    opened by brettwp 0
  • Error: type 'char' not found

    Error: type 'char' not found

    I cannot compile app with fusionauth-dart-client. It throws a lot of errors in terminal output. I tested version 1.36.0 from pub.dev and also directly from tag 1.36.8

    fusionauth_dart_client:
        git:
          url: https://github.com/FusionAuth/fusionauth-dart-client
          ref: 1.36.8
    

    I'm using flutter 3.0.5, dart 2.17 Here are a couple of them:

    ../../.pub-cache/git/fusionauth-dart-client-090ca757b8e8b8dcbf00669f1817511e0906caef/lib/src/FusionAuthDomain.dart:7396:3: Error: Type 'char' not found.
      char separator;
      ^^^^
    ../../.pub-cache/git/fusionauth-dart-client-090ca757b8e8b8dcbf00669f1817511e0906caef/lib/src/FusionAuthDomain.dart:35:13: Error: The parameter 'access_token' can't have a value of 'null' because of its type 'String', but the implicit default value is 'null'.
    Try adding either an explicit non-'null' default value or the 'required' modifier.
          {this.access_token,
                ^^^^^^^^^^^^
    ../../.pub-cache/git/fusionauth-dart-client-090ca757b8e8b8dcbf00669f1817511e0906caef/lib/src/FusionAuthDomain.dart:36:12: Error: The parameter 'expires_in' can't have a value of 'null' because of its type 'num', but the implicit default value is 'null'.
    Try adding either an explicit non-'null' default value or the 'required' modifier.
          this.expires_in,
               ^^^^^^^^^^
    ../../.pub-cache/git/fusionauth-dart-client-090ca757b8e8b8dcbf00669f1817511e0906caef/lib/src/FusionAuthDomain.dart:37:12: Error: The parameter 'id_token' can't have a value of 'null' because of its type 'String', but the implicit default value is 'null'.
    Try adding either an explicit non-'null' default value or the 'required' modifier.
          this.id_token,
               ^^^^^^^^
    
    
    opened by obiwanzenobi 3
Owner
FusionAuth
Best auth solution built for developers by developers
FusionAuth
Dart and Flutter sealed class generator and annotations, with match methods and other utilities. There is also super_enum compatible API.

Dart Sealed Class Generator Generate sealed class hierarchy for Dart and Flutter. Features Generate sealed class with abstract super type and data sub

6thSolution 15 Jan 2, 2023
A Side Menu plugin for flutter and compatible with liquid ui for flutter

Liquid Shrink Side Menu A Side Menu plugin for flutter and compatible with liquid ui Side Menu Types There are 8 configuration of Liquid shrink side m

Raj Singh 18 Nov 24, 2022
Whatsapp UI clone made with Flutter; it is compatible with any type of Android and iOS devices.

whats_app Whatsapp UI built with Flutter; it is compatible and responsive with any type of Android and iOS devices. Getting Started This project is a

Mustafa Nabavi 4 Sep 23, 2021
Flutter modern bottom navbar. Compatible with Android & iOS. You can customize it freely.

ss_bottom_navbar Flutter modern bottom nav bar. Compatible with Android & iOS. You can customize it freely. Getting Started dependencies: ss_bottom_

null 6 Sep 18, 2022
A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package. Built after react apollo

Flutter GraphQL Table of Contents Flutter GraphQL Table of Contents About this project Installation Usage GraphQL Provider [Graphql Link and Headers]

Snowball Digital 45 Nov 9, 2022
A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.

GraphQL Flutter ?? Bulletin See the v3 -> v4 Migration Guide if you're still on v3. Maintenance status: Low. Follow #762 for updates on the planned ar

Zino & Co. 3.1k Jan 5, 2023
Vrchat mobile client - VRChat Unofficial Mobile Client For Flutter

VRChatMC VRChatの非公式なAPIを利用したVRChatのモバイルクライアント Flutterで作成されたシンプルなUIが特徴的です iosビルドは

ふぁ 8 Sep 28, 2022
Mysql.dart - MySQL client for Dart written in Dart

Native MySQL client written in Dart for Dart See example directory for examples

null 48 Dec 29, 2022
A Dart client for the NATS messaging system. Design to use with Dart and Flutter.

Dart-NATS A Dart client for the NATS messaging system. Design to use with Dart and flutter. Flutter Web Support by WebSocket client.connect(Uri.parse(

Chart Chongcharoen 32 Nov 18, 2022
Socketio dart server and client - Full Socket.io implementation using Dart Lang

Getting Started Step 1: Run dart_server.dart Step 2: Android Emulator has proble

Trần Thiên Trọng 1 Jan 23, 2022
A streaming client for the Komga self-hosted comics/manga/BD server targeting Android/iOS written in Dart/Flutter

Klutter A streaming client for the Komga self-hosted comics/manga/BD server targeting Android/iOS written in Dart/Flutter Background This is a project

Mark Winckle 58 Dec 7, 2022
a project-m36 websocket client written by flutter/dart

project_m36_websocket_client A Flutter web websocket client for Project-M36. It's also an attempt to bring algebraic datatypes into the Dart land. Pro

null 1 Jan 8, 2022
Unsplash Client App written using dart and flutter. (Work in progress)

Upsplash Unofficial Unsplash client written using dart and flutter Sreenshots Architecture The goal of this pattern is to make it easy to separate pre

Arslan 25 Sep 1, 2022
A wrapper around our Cocoa and Java client library SDKs, providing iOS and Android support for those using Flutter and Dart.

Ably Flutter Plugin A Flutter plugin wrapping the ably-cocoa (iOS) and ably-java (Android) client library SDKs for Ably, the platform that powers sync

Ably Realtime - our client library SDKs and libraries 46 Dec 13, 2022
A cross-platform Fediverse client for micro-blogging services written in Flutter/Dart.

Kaiteki A 快適 (kaiteki) Fediverse client for microblogging instances, made with Flutter and Dart. Currently, Kaiteki is still in a proof-of-concept/alp

Kaiteki 141 Jan 5, 2023
A flutter/dart package that allows developer to develop shiSock client for there application.

A package which allow developers to develop the shiSock client for the there flutter android app. Using flutter-shiSock developers can develop a chat application very easily. It can also be used in app in which we need real time data flow.

shiSock 0 Apr 7, 2022
An Alchemy Platform client for Flutter & Dart

Alchemy An Alchemy Platform client for Flutter & Dart Report Bug · Request Feature Web3 development made easy One magic line of code supercharges your

Oliver Martinez 6 Jan 7, 2023
Dart client library to interact with Supabase Storage

storage-dart Dart client library to interact with Supabase Storage. Contributing Fork the repo on GitHub Clone the project to your own machine Commit

Supabase 22 Dec 14, 2022
Pure Dart Client for Nakama Server 🌟🥰🤩

Nakama Flutter Client ?? ?? ?? ?? Nakama is an open-source scalable game server. This is a Flutter client for Nakama written in pure dart and supports

Oliver Brunsmann 57 Dec 6, 2022