Clancey / simple_auth

The Simplest way to Authenticate in Flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase()' on a null object reference when following example

ThinkDigitalSoftware opened this issue · comments

I'm using this same code but with my own client secret and ID and I'm getting this error.

E/flutter (29433): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, Unsupported value: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase()' on a null object reference, null)

final simpleAuth.GithubApi githubApi = new simpleAuth.GithubApi(
"github", "clientId", "clientSecret", "redirect:/",
scopes: [
"user",
"repo",
"public_repo",
]);

My code is:

  final githubApi = GithubApi(
                    "github",
                    gitHubClientId,
                    gitHubClientSecret,
                    "com.thinkdigital.software",
                    scopes: [
                      "repo",
                      "public_repo",
                    ],
                  );
 githubApi.authenticate();

Actually the same issue here with Keycloak.

Same issue with Keycloak as well.