This folder contains 3 examples of using the openid_client package with a keycloak server:
flutter_example- a flutter exampleio_example- a command line examplebrowser_example- a browser (non-flutter) example
The examples use a keycloak server running on http://localhost:8080/realms/myrealm.
The keycloak server can be started by using the docker-compose.yml file in the example/keycloak-docker folder:
cd example/keycloak-docker
docker-compose upThis example shows how to use the openid_client package with a keycloak server in a flutter application. It has been tested on the following platforms:
- Android
- iOS
- Web
- MacOS
The app will show a single login button. Once pressed, a browser will be opened and the user will be asked to login or register. After a successful login, the user info will be shown.
This example can be run by:
dart run example/io_example/io_example.dartOnce started, a browser will be opened and the user will be asked to login or register. After a successful login, the user info will be printed to the command line.
Run this example by:
cd example/browser_example
webdev serve web:8888Then open http://localhost:8888 in a browser. Once the page is loaded, a login button will be shown. Once pressed, a browser will be opened and the user will be asked to login or register. After a successful login, the user info will be shown.