flutter_aad 0.2.6

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new76

flutter_aad

Pub Build Status codecov

A Dart package for interacting with the Azure Active Directiory platform (v1 and v2).

Warning: this project is very much still in development

Azure Active Directory Docs

Docs for this lib are available here.

[0.2.6] - 20180921

  • made refresh more selective

[0.2.5] - 20180921

  • added expand to list item calls

[0.2.4] - 20180920

  • improved sharepoint search call

[0.2.3] - 20180920

  • added sharepoint search call

[0.2.2] - 20180917

  • added stream for watching login state

[0.2.1] - 20180917

  • now have 100% coverage
  • fixed a couple of bugs found by improving the testing

[0.2.0] - 20180915

  • config is now stored on FlutterAAD instance so we don't have pass it into every function, but you can always make another instance with a different config if you need to!
  • with the move of the config into state it made sense to also store the token in state and update calls accordingly

[0.1.4] - 20180915

  • Improving descriptions

[0.1.3] - 20180915

  • fixed example to match new code pattern

[0.1.2] - 20180915

  • small bug really fixed

[0.1.1] - 20180915

  • small bug fix

[0.1.0] - 20180914

  • broke a LOT of function signatures... was needed for the auth-refresh
  • added apiVersion to AADConfig to keep the interface consistant
  • merged all v1 and v2 calls to take advantage of the new apiVersion in the config
  • now default to trying to refresh our token if need up to config.refreshTries times
  • moved non-token-refreshing versions out and renamed them as auto-refreshing should now be the default

[0.0.10] - 20180913

  • added example
  • working on docs
  • forgot the v2 variation of GetTokenMapWithAuthCode
  • added onError callbacks for all the calls that didn't have them before and needed them

[0.0.9] - 20180913

  • Added Get My Profile methods

[0.0.8] - 20180912

  • Added token refresh call and updates

[0.0.7] - 20180912

  • added get for full token to use when you need more than the access_token

[0.0.6] - 20180911

  • bit of refactoring

[0.0.5] - 20180911

  • little clean up and can now get list items either parsed for you or just the response (so you can send it into built_value directly if you like)

[0.0.4] - 20180910

  • added get list items api call

[0.0.3] - 20180910

  • testing should be good and getting tokens should be good

[0.0.2] - 20180910

  • Now has mocking for http tests
  • Started filling out the token system a bit more

[0.0.1] - 20180910

  • Getting the base in for what I'm doing now

example/main.dart

import 'dart:convert';
import 'dart:io';

import 'package:flutter_aad/flutter_aad.dart';

void main() async {
  Map<String, String> envVars = Platform.environment;
  final aadConfig = AADConfig(
      resource: envVars['AAD_RESOURCE'],
      clientID: envVars['AAD_CLIENT_ID'],
      redirectURI: envVars['AAD_REDIRECT_URI'],
      scope: [
        "openid",
        "offline_access",
        "Sites.Read.All",
        "User.Read",
        "profile"
      ]);

  var aad = FlutterAAD(aadConfig);

  final auth_code_uri = await aad.GetAuthCodeURI();
  print(
      "Please use a browsers to access the following url and then copy and paste the uri it redirected you to here:" +
          auth_code_uri);
  final redirected_uri = Uri.parse(stdin.readLineSync());

  if (!redirected_uri.hasQuery ||
      redirected_uri.queryParameters["code"] == null) {
    print("ERROR GETTING AUTH CODE!!!");
    print(redirected_uri);
    return;
  }

  final authCode = redirected_uri.queryParameters["code"];

  var full_token = await aad.GetTokenMapWithAuthCode(authCode);

  if (full_token == null) {
    print("ERROR GETTING TOKEN!!!");
    return;
  }

  print("Full token:");
  print(full_token);

  JsonEncoder encoder = new JsonEncoder.withIndent('  ');

  var profile = await aad.GetMyProfile();
  print("here is the profile:");
  print(encoder.convert(profile));

  var lists = await aad.GetListItems(aadConfig.resource, "Documents");
  print("Here is our lists:");
  print(encoder.convert(lists.map));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_aad: ^0.2.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_aad/flutter_aad.dart';
  
Version Uploaded Documentation Archive
0.2.6 Sep 22, 2018 Go to the documentation of flutter_aad 0.2.6 Download flutter_aad 0.2.6 archive
0.2.5 Sep 21, 2018 Go to the documentation of flutter_aad 0.2.5 Download flutter_aad 0.2.5 archive
0.2.4 Sep 20, 2018 Go to the documentation of flutter_aad 0.2.4 Download flutter_aad 0.2.4 archive
0.2.3 Sep 20, 2018 Go to the documentation of flutter_aad 0.2.3 Download flutter_aad 0.2.3 archive
0.2.2 Sep 18, 2018 Go to the documentation of flutter_aad 0.2.2 Download flutter_aad 0.2.2 archive
0.2.1 Sep 17, 2018 Go to the documentation of flutter_aad 0.2.1 Download flutter_aad 0.2.1 archive
0.2.0 Sep 16, 2018 Go to the documentation of flutter_aad 0.2.0 Download flutter_aad 0.2.0 archive
0.1.4 Sep 15, 2018 Go to the documentation of flutter_aad 0.1.4 Download flutter_aad 0.1.4 archive
0.1.3 Sep 15, 2018 Go to the documentation of flutter_aad 0.1.3 Download flutter_aad 0.1.3 archive
0.1.2 Sep 15, 2018 Go to the documentation of flutter_aad 0.1.2 Download flutter_aad 0.1.2 archive

All 22 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
53
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Sep 22, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.3

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:flutter_aad/flutter_aad.dart.

Suggestions

Format lib/src/aad_calls.dart.

Run dartfmt to format lib/src/aad_calls.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
http ^0.11.0 0.11.3+17 0.12.0
meta ^1.1.6 1.1.6
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
path 1.6.2
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
Dev dependencies
test ^1.3.0
test_coverage ^0.2.0