flutter_aad 0.3.4

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

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.3.4] - 20181106

  • moved to http 0.12.0

[0.3.3] - 20181101

  • helps if logggedIn works with fedAuth as well

[0.3.2] - 20181101

  • now keeping track of the host for you!

[0.3.1] - 20181101

  • host for FBAlogin should include protocol now
  • (still testing if this is stable)

[0.3.0] - 20181031

  • lots of spooky changes! (Suggest not touching this version until I have it evened out... sorry)
  • major changes to how auth is handled so that we can also (hopefully) handle "on site" Form Based Authentications

[0.2.9] - 20181022

  • fixed some params for search

[0.2.8] - 20181009

  • move back to 0.11.0 for http since that's what beta channel is on
  • added token getter that also returns the response so that you can get at the headers as well if needed

[0.2.7] - 20181004

  • use latest http

[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.3.4

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.3.4 Nov 6, 2018 Go to the documentation of flutter_aad 0.3.4 Download flutter_aad 0.3.4 archive
0.3.3 Nov 1, 2018 Go to the documentation of flutter_aad 0.3.3 Download flutter_aad 0.3.3 archive
0.3.2 Nov 1, 2018 Go to the documentation of flutter_aad 0.3.2 Download flutter_aad 0.3.2 archive
0.3.1 Nov 1, 2018 Go to the documentation of flutter_aad 0.3.1 Download flutter_aad 0.3.1 archive
0.3.0 Nov 1, 2018 Go to the documentation of flutter_aad 0.3.0 Download flutter_aad 0.3.0 archive
0.2.9 Oct 22, 2018 Go to the documentation of flutter_aad 0.2.9 Download flutter_aad 0.2.9 archive
0.2.8 Oct 10, 2018 Go to the documentation of flutter_aad 0.2.8 Download flutter_aad 0.2.8 archive
0.2.7 Oct 5, 2018 Go to the documentation of flutter_aad 0.2.7 Download flutter_aad 0.2.7 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

All 30 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
63
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]
81
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.6

Platforms

Detected platforms: Flutter, web, other

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
corsac_jwt ^0.1.2 0.1.2
http ^0.12.0 0.12.0
meta ^1.1.6 1.1.6
Transitive dependencies
asn1lib 0.5.3
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
http_parser 3.1.3
logging 0.11.3+2
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