Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 50 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,55 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.dart_tool/
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/**

.DS_Store

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/

build/
flutter_*.png
linked_*.ds
unlinked.ds
unlinked_spec.ds

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
**/android/key.properties
**/android/key-release.properties
*.jks
**/android/.idea/*


gradlew
gradlew.bat
local.properties
.gradle/5.6.4/gc.properties
.gradle/5.6.4/fileChanges/last-build.bin
.gradle/buildOutputCleanup/cache.properties
.gradle/vcs-1/gc.properties
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
19 changes: 0 additions & 19 deletions .idea/libraries/Dart_SDK.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/libraries/Flutter_for_Android.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/runConfigurations/example_lib_main_dart.xml

This file was deleted.

45 changes: 0 additions & 45 deletions .idea/workspace.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .metadata

This file was deleted.

16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,18 @@

## 0.1.4

* New documentation on setting up Azure delegated permissions
* New documentation on setting up Azure delegated permissions

## 1.0.0

* Add ability to specify a login hint to MSAL when acquiring a token
> **_NOTE:_** Version 1.0.0 contains a breaking change to the MSAL Mobile ready callback. MSAL Mobile's create function no longer returns a future. Instead it returns an authentication interface that exposes an isReady future property.\
\
The following:\
`MsalMobile.create('assets/auth_config.json', authority).then((client) { ... });`
\
\
Now becomes:\
`IAuthenticator authenticator = MsalMobile.create('assets/auth_config.json', authority);
authenticator.isReady.then((client) { ... });
`
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ A Flutter plugin for authenticating with Azure AD on Android and iOS using the M

The plugin wraps the Android and iOS MSAL libraries from Microsoft. MSAL Mobile currently only supports a single account at a time. The API allows for a user to be signed in or out, retrieve basic information about the signed in user and acquire tokens both interactively and silently.

## Version 1.0 Breaking Change
Version 1.0 contains a breaking change to the MSAL Mobile ready callback.

The following:\
`MsalMobile.create('assets/auth_config.json', authority).then((client) { ... });`
\
\
Now becomes:\
`IAuthenticator authenticator = MsalMobile.create('assets/auth_config.json', authority);
authenticator.isReady.then((client) { ... });
`

## Project Requirements

* Flutter version greater than 1.12
Expand All @@ -14,7 +26,7 @@ The plugin wraps the Android and iOS MSAL libraries from Microsoft. MSAL Mobile
Add the following to your pubspec.yaml
```yaml
dependencies:
msal_mobile: ^0.1.4
msal_mobile: ^1.0.0
```

# Azure Setup
Expand Down Expand Up @@ -220,7 +232,8 @@ class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
MsalMobile.create('assets/auth_config.json', "https://login.microsoftonline.com/Organizations").then((client) {
IAuthenticator authenticator = MsalMobile.create('assets/auth_config.json', "https://login.microsoftonline.com/Organizations");
authenticator.isReady.then((client) {
setState(() {
msal = client;
});
Expand All @@ -243,9 +256,16 @@ Sign out
await msal.signOut()
```

Get token - attempt silent acquisition and fallback to interactive acquisition
Get token - attempt silent acquisition and fallback to interactive acquisition. Takes a login hint as an optional third parameter.
```dart
await msal.acquireToken(["api://[app-registration-client-id]/[delegated-permission-name]"]], "https://login.microsoftonline.com/Organizations", "some_username_hint".then((result) {
print('access token (truncated): ${result.accessToken}');
})
```

Get token with login hint - attempt silent acquisition and fallback to interactive acquisition. Takes a login hint as an optional third parameter.
```dart
await msal.acquireToken(["api://[app-registration-client-id]/[delegated-permission-name]"]], "https://login.microsoftonline.com/Organizations").then((result) {
await msal.acquireTokenWithLoginHint(["api://[app-registration-client-id]/[delegated-permission-name]"]], "https://login.microsoftonline.com/Organizations", "some_username").then((result) {
print('access token (truncated): ${result.accessToken}');
})
```
Expand Down
59 changes: 53 additions & 6 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,55 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
*.ipr
*.iws
.idea/**

.DS_Store
/build
/captures

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
build/
flutter_*.png
linked_*.ds
unlinked.ds
unlinked_spec.ds

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
**/android/key.properties
**/android/key-release.properties
*.jks
**/android/.idea/*


gradlew
gradlew.bat
local.properties
.gradle/5.6.4/gc.properties
.gradle/5.6.4/fileChanges/last-build.bin
.gradle/buildOutputCleanup/cache.properties
.gradle/vcs-1/gc.properties
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
Loading