FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    fusionauth with flutter

    Scheduled Pinned Locked Moved
    Q&A
    2
    2
    717
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mak
      last edited by

      We are trying to integrate fusionAuth with flutter and I have already refereed to the posts

      https://pub.dev/packages/flutter_appauth/example
      //https://fusionauth.io/community/forum/topic/428/social-login-with-flutter-app/6

      I have tried the code and it works good with Auth0 but I am not able to get it working with fusionAuth

      here is the link to Auth0 code
      https://github.com/auth0-blog/flutter-authentication/blob/main/lib/main.dart

      I replaced the code with FusionAuth credentials, it opens the webclient but after authentication callback I get the below error..

      Below is the code

      const String FUSIONAUTH_DOMAIN= 'fusionauth.mydomain.com';
      const String FUSIONAUTH_CLIENTID = 'xxxxxxx-83a4-4523-823e-2b4390df1ef8';
      const String FUSIONAUTH_REDIRECT_URI = 'com.test.flutter://login-callback';
      const String FUSIONAUTH_ISSUER = 'https://$FUSIONAUTH_DOMAIN';
      const String FUSIONAUTH_DISCOVERY_URL = 'https://fusionauth.mydomain.com/.well-known/openid-configuration/xxxxxxx-9068-48fb-9af4-7b279d66395c';

      final List<String> _scopes = <String>[
      'openid',
      'profile',
      'email',
      'offline_access',
      'api'
      ];

      Future<void> loginAction() async {
      setState(() {
      isBusy = true;
      errorMessage = '';
      });
      try {
      AuthorizationTokenResponse result;
      await appAuth.authorizeAndExchangeCode(
      AuthorizationTokenRequest(
      FUSIONAUTH_CLIENTID,
      FUSIONAUTH_REDIRECT_URI,
      issuer: FUSIONAUTH_ISSUER,
      //discoveryUrl: FUSIONAUTH_DISCOVERY_URL,
      scopes: _scopes,
      ),
      );

      .. rest of the code is same from Auth0 example..

      It throws me an error saying
      [ error:invalid_client_descripition, C
      Client authentication missing as Basic Authorization header or credentials in the body (or some combination of them).], null, null

      if somebody can point what am I doing wrong

      1 Reply Last reply Reply Quote 0
      • danD
        dan
        last edited by

        We just published a flutter tutorial that might be worth reading: https://fusionauth.io/blog/2020/11/23/securing-flutter-oauth/

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • First post
          Last post