Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Actually that's an issue Clancey/simple_auth#101
    Alban Zeka
    hi all
    can anyone point me to a GitHub example that has token authentication with azure ad or oauth2?
    Federico Grosso
    Hi! I am trying to authenticate with Azure AD using simple_auth_flutter, but I am having a problem with the redirect on android. If I use the client secret, the app uses a WebView instead of the browser and the redirect is not handled ok throwing ERR_UNKNOWN_URL_SCHEME. If the secret is not set, the redirects is handled correctly. Is there a way to handle custom schemes of simple_auth_flutter using client secret?
    James Clancey
    You have to register the redirect with azure
    Federico Grosso
    I have registered the redirect in Azure (Home > App registrations > My App - Authentication) Redirect URIs - Public client. The redirect is working correctly when I have no Client Secret (it opens the default device browser), but when I added one Client Secret it uses an internal WebView, which can not handle the custom scheme (which is defined in the Manifest)
    James Clancey
    If you use the internal you can use any redirect, like localhost
    Manifest is only used when you use the external browser
    Can anyone help me? I use simple_auth_flutter and use useEmbeddedBrowser = true but the window to login does not close after successful login. The .authenticate() method returns an OAuthAccount object with a token, but the window does not go away.
    Assane Dessables
    @puhtze maybe you have to explicitly close in the callback?
    Possible. But how? I also do remember seeing this closing by itself. Maybe the latest Flutter Version broke it?
    @puhtze maybe your app is in debug mode? Try the release mode.
    Marko Divjak
    how you handle refresh tokens with Keycloak?
    vinay reddy vankayala
    @Clancey simple_auth_flutter Azure login for android is not redirecting after login. Sample app in the github is also not working. Can you look into it. Thanks.
    @VankayalaReddy_twitter how far did you get with your authentication with Azure. I'm really struggling to get it to work
    What should the redirect be setup as? I'm missing the point of the redirect? I'll be connecting from an app

    I'm trouble with the redirection from azure and facebook api's too @klops-za .
    I tried several ways to configure the return route path from facebook developers and azure active directory configuratiions, but with no results. On the facebook for example, i don't see any option to set the uri in another pathern that no use the http:// protocol. And in the azure, after a pre configuration, the server generate a uri pattern with the prefix msauth://, followed to the application package and an identifier code. But in the simple auth activity, even if I change the data tag to accept the appropriate standards, the login is still not redirected to the application.

    I try use the simple_auth_flutter 2.0.4 in my own application and after some tests, i use directly on the git hub example code. The example with the google api worked perfectly. I even created another application of my own on google developers, and it also worked. But as stated above, I encounter problems with facebook and azure apis.


    @CatalinBoiangiu Thanks for posting the sample auth helper. I am a Flutter novice so some of my questions maybe obvious for some of you here. I have a form (below) I like to call the helper class to authenticate Keycloak bearer only. I am sure I set up the URLs, client id and secret correct since I can bearer authenticate using Java with the same values.

    Map<String, String> getAuthHeaders() {
    return {'Authorization': 'Bearer ${KC_OAuth.currentOauthAccount.token}'};
    the value currentOauthAccount is null
    onPressed: () {
    child: Text(
    color: Colors.blueAccent,
    textColor: Colors.white,

    E/flutter ( 4156): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The getter 'token' was called on null.
    E/flutter ( 4156): Receiver: null
    E/flutter ( 4156): Tried calling: token
    E/flutter ( 4156): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
    E/flutter ( 4156): #1 KeycloakAuth.getAuthHeaders
    E/flutter ( 4156): #2 KeycloakAuth.getKeycloakUsers
    E/flutter ( 4156): #3 _CheckInFormState.build.<anonymous closure>
    E/flutter ( 4156): #4 _InkResponseState._handleTap
    E/flutter ( 4156): #5 _InkResponseState.build.<anonymous closure>
    E/flutter ( 4156): #6 GestureRecognizer.invokeCallback

    Rakshith G
    hello simple_auth, I have a backend oAuth code written on node.js. I have to integrate it to flutter. Can anyone guide me on the process to follow, here is the link to the Node.JS code: https://github.com/Rakshak1344/OAuth
    I have a Google and Facebook Passport Strategy on Node.JS which accepts authorization code. Further, the code is exchanged for the access token
    Naveen yadav
    How can i integrate facebook and instagram auth via this plugin i didn't understand the example.
    i m new to flutter and I m trying to make reddit authentication using Draw. I am unable to find how to get 'Code' query parameter from redirect url. I also tried Web authentication Flow tht is in test/auth/web_auth.dart .
    https://github.com/draw-dev/DRAW for installed app authentication
    Luis Felipe Dominguez Vega
    im using simple auth with keycloak, but when the WebView need to come back then a PlatformException ocurred
    something with the saving of secured data
    Long Nguyen
    hey everybody
    I have a problem need to resolve.
    on mobile, My browser do not redirect to app after login success.
    it show notify Open my app but not working
    Hello, return _igApi.authenticate().then(
    return catch
    Invalid argument(s)
    how to resolve?
    i want to integrate my flutter app with keycloak installed on local machine. (Client id, Client secrete , baseUrl,realm) this parameters are getting from keycloak instance created on locally. what should i give "identifier" and "redirecturl" ? i have chose the redirecturl=from identifier(githhub,google) panel since i am trying to connect keyclock with (githhub,google). it is giving me errors like this when i am calling
    " var profile=keyclockApi.getUserProfile(); "
    Luca Panteghini

    I'm trying to implement Keycloack auth in a Flutter Web application but I don't understand the correct way to do that, here my code:

      import 'package:simple_auth/simple_auth.dart' as simpleAuth;
      import 'package:simple_auth_flutter/simple_auth_flutter.dart';
      void initState() {
      authenticate() async {
        String identifier = 'keycloak';
        String clientId = 'myclientid';
        String clientSecret = "realm-public-key";
        String redirectUrl = 'http://localhost:3000/';
        String baseUrl = 'https://test-myurl.com/auth/';
        String realm = 'myrealm';
        simpleAuth.KeycloakApi keycloakApi = simpleAuth.KeycloakApi(
            scopes: ['openid', 'profile']
        var response = await keycloakApi.authenticate();

    I receive this error on startup, when he try to initialize and the same error when I launch the authenticate function:

    ======== Exception caught by services library============
    The following MissingPluginException was thrown while activating platform stream on channel simple_auth_flutter/urlChanged:
    MissingPluginException(No implementation found for method listen on channel simple_auth_flutter/urlChanged)

    Someone has an example to follow?


    hi everyone,
    i was trying to make a small auth app for github..

    my query is what is the reddict url?

    the app works fine,
    its logs in but stops as there is no reddict..
    can any one tell what is this reddict url?

    Hello, does simple auth support Flutter web?
    @maxpill it's a bit a keycloak question but see the comments -> no web in simple_auth.

    Hey everybody! :)
    I am trying to implement an auth solution. I have been given a backend, which uses a POST request with two separate named parameters "user" and "pwd" for username and password. So, e.g http://my-api.io/auth?user=test&pwd=password is used.

    However, this does not match the BasicAuthentication given in your project (which uses the username:password convention). Therefore I wanted to ask whether there is an easy solution to auth using this apporach using existing classes or I am forced to craft my own custom authenticator and API? Thanks in advance :)

    Achudh Krishna

    i want to integrate my flutter app with keycloak installed on local machine. (Client id, Client secrete , baseUrl,realm) this parameters are getting from keycloak instance created on locally. what should i give "identifier" and "redirecturl" ? i have chose the redirecturl=from identifier(githhub,google) panel since i am trying to connect keyclock with (githhub,google). it is giving me errors like this when i am calling
    " var profile=keyclockApi.getUserProfile(); "

    Getting the same error @Nilesh-Chaudahri

    @Achudh you can give identity provide as '' or simply Keycloak, redirectorUrl: one that you have provide in AndroidManifest file. '<activity android:name="clancey.simpleauth.simpleauthflutter.SimpleAuthCallbackActivity" >
    <intent-filter android:label="simple_auth">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="com.myapp.foo" />
    </activity>' (if you see the documentation it is mention in document as example"com.myapp.foo". you can change it.). also this redirect url must be mention in keycloak at redirect url section call var profile= keyCloak.performAuthenticate()
    @Clancey I have integrated the the keycloak with simple_auth. It is working fine. Now I want to bypass the keycloak UI Console and directly want to hit the identity providers that integrated with that realm. can you give light on this ?
    hi guys. I am able to get the Facebook popup working and the auth flow works. I'm trying to get the accessToken from the flow so I can pass it to my KeyCloak server as a token exchange. I've done this with the google_sign_in plugin. But cannot find a way to replicate because no token is returned that I can see. Any pointers appreciated.
    Hi, can someone help? Trying to use Keycloak with Simple_Auth. Simple login works like a charm, but if the user wants to register, the flow is different. After registration and email-verification, the redirect is different from login. The code don't comes back "from the future" and I have no idea what to do in this situation. Could you give me a hint? I use the latest version of simple_auth. The device is an iphone-simulator.
    client secret isnt something you're supposed to use in the client, but the example code shows this as required parameters. is this normal?
    Hi, how I can implement a policy-based authorization in ASP.NET Core and KeyCloack? How I should configure keycloack and the asp.net core web app? Is there any simple example for that? Thanks in advance!