oneid_sdk 2026.919.6 copy "oneid_sdk: ^2026.919.6" to clipboard
oneid_sdk: ^2026.919.6 copied to clipboard

Flutter SDK for OneID authentication using a vendored AppAuth 2 and a DPoP-bound OAuth 2.0 Authorization Code flow.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:oneid_sdk/oneid_sdk.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late final _auth = OneIdAuth(
    OneIdAuthConfig(
      environment: OneIdEnvironment.uat,
      clientId: 'example-client',
      redirectUrl: 'com.ronforddigital.oneid.example://callback',
    ),
  );

  String _status = 'Not signed in';

  @override
  void dispose() {
    _auth.dispose();
    super.dispose();
  }

  Future<void> _login() async {
    setState(() => _status = 'Signing in…');
    try {
      final tokens = await _auth.login();
      setState(() => _status = 'Signed in (${tokens.tokenType} token)');
    } on OneIdException catch (e) {
      // Expected until the vendored AppAuth 2 + DPoP native integration
      // lands β€” see the TODOs on OneidSdkPlugin (android/ios).
      setState(() => _status = 'Sign-in failed: ${e.message}');
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('OneID SDK example')),
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              Text(_status),
              const SizedBox(height: 16),
              ElevatedButton(onPressed: _login, child: const Text('Sign in')),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
150
points
198
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter SDK for OneID authentication using a vendored AppAuth 2 and a DPoP-bound OAuth 2.0 Authorization Code flow.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter, http, meta

More

Packages that depend on oneid_sdk

Packages that implement oneid_sdk