Earlybyte / aad_oauth

Flutter Azure Active Directory OAuth Package
https://pub.dev/packages/aad_oauth
MIT License
92 stars 186 forks source link

How navigate directly to a particular screen after authentication. #285

Open ArivananthaPandian0312 opened 8 months ago

ArivananthaPandian0312 commented 8 months ago

I have a login screen with login button, on the click of the login button it will open the Microsoft authentication webpage and user can login with his credentials , but after authentication it comes back to LoginScreen for a sec and then navigates to HomeScreen. Is there any way to directly navigate user to the HomeScreen after successful authentication.

Refaydeen commented 8 months ago

can you give a code for referece because i had some error while running,first one is i m developing pwa but in mobile client secret key or client assertion key error and in web it is not printing in console anything

gijominuscule commented 4 months ago

void loginByAzure(bool redirect) async { final Config config = Config( tenant: 'xxxxxxxx', clientId: 'yyyyyyy', scope: 'email openid', redirectUri: ds, navigatorKey: navigatorKey, loader: SizedBox(), appBar: AppBar( title: Text('Azure Login'), ), clientSecret: '4444444444', onPageFinished: (String url) { print('onPageFinished: $url'); }, postLogoutRedirectUri: 'https://www.app.cryotos.com', ); final AadOAuth oauth = AadOAuth(config); config.webUseRedirect = redirect; final result = await oauth.login(); result.fold( (l) => showError(l.toString()), (r) => showMessage('Logged in successfully, your access token: $r'), ); var accessToken = await oauth.getAccessToken(); if (accessToken != null) { ScaffoldMessenger.of(context).hideCurrentSnackBar(); ScaffoldMessenger.of(context) .showSnackBar(SnackBar(content: Text(accessToken))); } }

after authentication success came back to mobileview loginpage its not working

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you still think this issue is needed, reopen it again.