microsoft_kiota_azure 0.1.0 copy "microsoft_kiota_azure: ^0.1.0" to clipboard
microsoft_kiota_azure: ^0.1.0 copied to clipboard

Provides an implementation of a Kiota AuthenticationProvider for Azure authentication.

example/lib/example.dart

// ignore_for_file: unused_local_variable
import 'package:microsoft_kiota_azure/microsoft_kiota_azure.dart';
import 'package:microsoft_kiota_bundle/microsoft_kiota_bundle.dart';

Future<void> main() async {
  // choose your authentication flow:
  final credential = await deviceCodeFlow();

  final authProvider = AzureAuthenticationProvider.withCredential(
    credential,
    scopes: ['User.Read'],
  );
  final adapter = DefaultRequestAdapter(authProvider: authProvider);

  // ... pass adapter to the generated API client
}

Future<DeviceCodeCredential> deviceCodeFlow() async {
  return DeviceCodeCredential('clientId', (deviceCodeInfo) {
    print(deviceCodeInfo.message);
    print('Please go to ${deviceCodeInfo.verificationUri} and enter the code');
  });
}
0
likes
160
points
31
downloads

Publisher

verified publishergraph.microsoft.com

Weekly Downloads

Provides an implementation of a Kiota AuthenticationProvider for Azure authentication.

Homepage
Repository (GitHub)
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

http, microsoft_kiota_abstractions, std_uritemplate

More

Packages that depend on microsoft_kiota_azure