sharepoint_auth 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 66

sharepoint_auth #

Get sharepoint access token package to access SHAREPOINT REST API.

Sharepoint Access Token #

A Flutter sharepoint_auth package for performing authentication to retrieve access token for accessing SHAREPOINT REST API by using OAuth2 v2.0 endpoint. Forked from Earlybyte.aad_oauth AAD Package.

Usage❔ #

For using this library you have to create an azure app at the Azure App registration portal. Use native app as plattform type.

Register App on Sharepoint Site by using : https://YourDomainName.SharePoint.com/sites/YourSiteName/_layouts/15/appregnew.aspx

Afterwards you have to initialize the library as follow:

 final SharepointConfig config = new SharepointConfig(
      "Sharepoint Client Id",
      "Sharepoint Client Secret",
      "Sharepoint Resource",
      "Sharepoint Site",
      "Your Tenant Id",);
    final Sharepointauth sharepointauth = new Sharepointauth(config);

This allows you to pass in Client Id, Client Secret, Sharepoint Resource, Sharepoint Site and Tenant Id.

Then once you have an Sharepointauth instance, you can call login() and afterwards getAccessToken() to retrieve an access token:

await sharepointauth.login();
String accessToken = await sharepointauth.getAccessToken();

You can also call getAccessToken() directly. It will automatically login and retrive an access token.

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

Tokens have expire offset of 1800 secs:

await sharepointauth.logout();

💻 Installation #

Add the following to your pubspec.yaml dependencies:

dependencies:
  sharepoint_auth: "^0.1.0"

👨 Created & Maintained By

Shail Patel

If you found this project helpful or you learned something from the source code and want to thank me, consider buying me a cup of ☕

Say Thanks!

The source code is 100% Dart, and everything resides in the /lib folder.

Show some ❤️ and star the repo to support the project

GitHub followersGitHub stars GitHub forks GitHub watchers Twitter Follow

Open Source Love License

❤️ Found this project useful? #

If you found this project useful, then please consider giving it a ⭐ on Github and sharing it.

👍 How to Contribute #

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -m 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

📃 License #

Copyright 2019 Shail Patel

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Questions?🤔 #

Hit me on twitter Twitter URL LinkedIn

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[0.1.0] - 2019/04/22

  • Bug fixes
  • Created example project
  • Update readme file
  • Adjusted library interface

[0.0.3] - 2019/04/22

  • Fixed url issues on readme file

[0.0.2] - 2019/04/22

  • Updates and clean up
  • Started working on readme file

[0.0.1] - 2019/04/22

  • Initial release

example/README.md

sharepoint_auth example #

Get sharepoint access token package to access SHAREPOINT REST API.

For using this library you have to create an azure app at the Azure App registration portal. Use native app as plattform type.

Register App on Sharepoint Site by using : https://YourDomainName.SharePoint.com/sites/YourSiteName/_layouts/15/appregnew.aspx

Afterwards you have to initialize the library as follow:

 final SharepointConfig config = new SharepointConfig(
      "Sharepoint Client Id",
      "Sharepoint Client Secret",
      "Sharepoint Resource",
      "Sharepoint Site",
      "Your Tenant Id",);
    final Sharepointauth sharepointauth = new Sharepointauth(config);

This allows you to pass in Client Id, Client Secret, Sharepoint Resource, Sharepoint Site and Tenant Id.

Then once you have an Sharepointauth instance, you can call login() and afterwards getAccessToken() to retrieve an access token:

await sharepointauth.login();
String accessToken = await sharepointauth.getAccessToken();

You can also call getAccessToken() directly. It will automatically login and retrive an access token.

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

Tokens have expire offset of 1800 secs:

await sharepointauth.logout();

💻 Installation #

Add the following to your pubspec.yaml dependencies:

dependencies:
  sharepoint_auth: "^0.1.0"

Questions?🤔 #

Hit me on twitter Twitter URL LinkedIn

Use this package as a library

1. Depend on it

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


dependencies:
  sharepoint_auth: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:sharepoint_auth/sharepoint_auth.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
32
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
66
Learn more about scoring.

We analyzed this package on Oct 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

64 out of 64 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_secure_storage ^3.2.1+1 3.3.1+1
http ^0.12.0+2 0.12.0+2
shared_preferences ^0.5.2 0.5.3+5
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.11 1.14.12
http_parser 3.1.3
meta 1.1.7
path 1.6.4
pedantic 1.8.0+1
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test