The controllers folder has a TaskController which is responsible for maintaining the current state as well as performing all the task operations with the server.Īs described in the web flow in the Oauth Server Demo readme file, the authentication process begins here with the client. There's a logout button on the top right corner.Īs I mentioned, GetX is used for state management. There's a + button at the top to add a new fake tasks. The MainPage will retrieve all the active tasks from the server. The MainPage will display if the user is logged in. The LoginPage widget will be called if the user is logged out and display the four provider choices to login with. There are only two pages the pages folder. GetMaterialApp will decide which page to display based on the logged-in status of the user. The localized arb files are in the l10n folder. In main.dart look for the locale parameters in GetMaterialApp to try different languages (one of en, fr, ar, or he will work). The Hebrew/Arabic translations are just Google Translate strings. The app is localized in English, French, Hebrew, and Arabic. I use the VSCode Flutter Intl plugin for internationalization (it's also available for Android Studio). It ensures that I keep text strings out of the code, but also allows me to check things like RTL languages. I internalizationalize all my Flutter apps as a matter of course. This is not intended to be a GetX demonstrator, it just happens to be what I use for those functions. I use GetX for state management, navigation, and a few other useful functions (displaying snackbars). The server component is not as it depends on the mongodb_dart plugin which is not yet null-safe. It has been tested to work on iOS, Android, MacOS, Linux and Windows (not web). This client app maintains Login state as well as a local copy of all the tokens (access, refresh, and id). Those calls include an id_token to ensure the API call is valid. In order to also demonstrate API calls with token validation, this client creates fake tasks and makes API calls to store and retreive those tasks. To understand the details of how this complete flow works, check the readme file on the server repo for the complete authentication flow. The OAuth2 server demonstrator will receive all the redirect calls from all of the providers to complete the authentication process. The primary purpose of this client is to initiate the authentication flow with one of Google, Apple, Facebook or Github. OAuth2 Demonstrator - Flutter Client ComponentĪn OAuth2 Demonstrator Client Companion to Oauth2 Server Demonstrator.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |