oidc 0.5.2 copy "oidc: ^0.5.2" to clipboard
oidc: ^0.5.2 copied to clipboard

A comprehensive OpenIdConnect plugin that works on all platforms (android, ios, windows, linux, web, macos)

oidc #

Pub Version last commit codecov style: very good analysis License: MIT

An OpenId Connect RP (Relying Party) plugin for flutter.

Make sure you read the Wiki for extra information.

Table Of Contents #

Introduction ✨ #

This federated plugin builds on top of oidc_core to add platform-specific handling which is required by the spec (e.g. launching a browser, listening for redirect, etc...).

Installation 💻 #

❗ In order to start using this plugin you must have the Flutter SDK installed on your machine.

Add to your pubspec.yaml:

dart pub add oidc oidc_default_store

Usage 🛠️ #

After following the Getting Started steps, it's as easy as:

//1. create the manager:
final manager = OidcUserManager.lazy(
    discoveryDocumentUri: OidcUtils.getOpenIdConfigWellKnownUri(
        Uri.parse('https://server.example.com'),
    ),
    // TODO: add other settings
);

//2. init()
await manager.init();

//3. listen to user changes
manager.userChanges().listen((user) {
  print('currentUser changed to $user');
});

//4. login
final newUser = await manager.loginAuthorizationCodeFlow();

//5. logout
await manager.logout();

Features 📚 #

  • 🧩 Cross platform: most features work on all platforms that can run flutter (Android, Ios, macos, web, windows, linux).
  • 🧰 High maintenance: everyone hates having to fix an unmaintained package. you can trust that we will solve issues as soon as they pop up. especially since we use this package in all our production apps.
  • ⚙️ Customizability: you can customize everything; Where to store the data, provide your own http client, extend requests/responses with your own data; whatever you want, you can do.
  • 🚀 Easy to use: you mainly need to concern yourself with the OidcUserManager class, which is very well documented and has a simple interface.

📜 Conformance #

Implemented specs #

WIP Specs #


Plugin Generated by the Very Good CLI 🤖