Skip to content

Commit

Permalink
Fixed issue with SignInUserSilent() calling a synchronous native meth…
Browse files Browse the repository at this point in the history
…od in Android rather than an async method.
  • Loading branch information
wrobins committed Feb 21, 2024
1 parent 5599f07 commit 35a5c55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-msal",
"version": "4.1.0",
"version": "4.1.1",
"description": "A Cordova plugin providing a wrapper for Microsoft's MSAL library for Android and iOS.",
"cordova": {
"id": "cordova-plugin-msal",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-msal" version="4.1.0">
id="cordova-plugin-msal" version="4.1.1">
<name>Cordova MSAL Plugin</name>
<description>A Cordova plugin providing a wrapper for Microsoft's MSAL library for Android and iOS.</description>
<author>Walter Robins</author>
Expand Down
5 changes: 3 additions & 2 deletions src/android/MsalPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ public void run() {
AcquireTokenSilentParameters params = new AcquireTokenSilentParameters.Builder()
.withScopes(Arrays.asList(MsalPlugin.this.scopes))
.fromAuthority(authority)
.forAccount(MsalPlugin.this.appSingleClient.getCurrentAccount().getCurrentAccount())
.withCallback(new SilentAuthenticationCallback() {
@Override
public void onSuccess(IAuthenticationResult authenticationResult) {
Expand All @@ -338,7 +339,7 @@ public void onError(MsalException exception) {
}
})
.build();
MsalPlugin.this.appSingleClient.acquireTokenSilent(params);
MsalPlugin.this.appSingleClient.acquireTokenSilentAsync(params);
}
} catch (InterruptedException e) {
MsalPlugin.this.callbackContext.error(e.getMessage());
Expand Down Expand Up @@ -381,7 +382,7 @@ public void onError(MsalException exception) {
}
})
.build();
MsalPlugin.this.appMultipleClient.acquireTokenSilent(params);
MsalPlugin.this.appMultipleClient.acquireTokenSilentAsync(params);
} catch (InterruptedException e) {
MsalPlugin.this.callbackContext.error(e.getMessage());
} catch (MsalException e) {
Expand Down

0 comments on commit 35a5c55

Please sign in to comment.