aad_oauth 0.0.1 copy "aad_oauth: ^0.0.1" to clipboard
aad_oauth: ^0.0.1 copied to clipboard

outdated

Fluter Azure Active Directory OAuth Package

Azure Active Directory OAuth #

A Flutter OAuth package for performing user authentication against Azure Active Directory OAuth2 v2.0 endpoint for your apps. Forked from hitherejoe.FlutterOAuth.

Supported Flows:

Usage #

Performing authorization for an API is straight forward using this library. In most cases you will just be able to use the following approach:

final String azureClientId = "YOUR_CLIENT_ID";
final String azureTennant = "YOUR_TENANT_ID";
final Config oAuthConfig = new Config(
    "https://login.microsoftonline.com/$azureTennant/oauth2/v2.0/authorize",
    "https://login.microsoftonline.com/$azureTennant/oauth2/v2.0/token",
    azureClientId,
    "https://login.live.com/oauth20_desktop.srf",
    "code",
    "openid profile offline_access",
    contentType: "application/x-www-form-urlencoded");
final AadOAuth oauth = new AadOAuth(oAuthConfig);

This allows you to pass in an Authorization URL, Token request URL, Client ID, Redirect URL, Response Type (always "code"), Scope and the content type (always "application/x-www-form-urlencoded").

Then once you have an OAuth instance, you can simply call getAccessToken() method to retrieve a access token:

String accessToken = await oauth.getAccessToken();

getAccessToken() will perform necessary authentication steps (full authorization code flow or just refresh code flow).

Tokens are cached in memory. If you want to destroy the tokens you can call logout()

await oauth.logout();

Installation #

Add the following you your pubspec.yaml dependancies:

dependencies:
  aad_oauth: "^0.0.1"
139
likes
0
pub points
97%
popularity

Publisher

verified publisherearlybyte.ch

Fluter Azure Active Directory OAuth Package

Homepage

License

unknown (LICENSE)

Dependencies

flutter, flutter_webview_plugin, http

More

Packages that depend on aad_oauth