LoginManager constructor
LoginManager(
- AuthInfo authInfo
Implementation
LoginManager(AuthInfo authInfo) {
if (PlatformGlobals.isTv) {
client = OAuth2Client(
authorizeUrl: authInfo.authorizeUrl,
tokenUrl: authInfo.tokenUrl,
redirectUri: "my.test.app:/oauth2redirect", // TODO
customUriScheme: "my.test.app",
);
} else if (PlatformGlobals.isMobile) {
client = OAuth2Client(
authorizeUrl: authInfo.authorizeUrl,
tokenUrl: authInfo.tokenUrl,
redirectUri: "my.test.app:/oauth2redirect", // TODO
customUriScheme: "my.test.app",
);
} else if (PlatformGlobals.isWeb) {
client = OAuth2Client(
authorizeUrl: authInfo.authorizeUrl,
tokenUrl: authInfo.tokenUrl,
redirectUri: AuthGlobals.redirectUriWeb,
// refreshUrl: "https://auth.${GlobalSettings.domainName}/oauth/token",
customUriScheme: Uri.parse(AuthGlobals.redirectUriWeb).authority,
);
} else{
// Used for Linux for example
client = OAuth2Client(
authorizeUrl: authInfo.authorizeUrl,
tokenUrl: authInfo.tokenUrl,
redirectUri: "http://localhost:8000/redirect.html",
customUriScheme: "http://localhost:8000",
);
}
if (kIsWeb) {
baseWebAuth = CustomWebBase();
}
}