auth0 / auth0-java

Java client library for the Auth0 platform
https://auth0.com
MIT License
295 stars 130 forks source link

Add MFA Authentication policies to GuardianEntity #379

Closed pelletier197 closed 3 years ago

pelletier197 commented 3 years ago

Changes

I added the endpoints for that were missing. This is kind of required to enable the MFA for your application.

Testing

AuthAPI auth = new AuthAPI("<>", "<>", "<>");
ManagementAPI api = new ManagementAPI("<>", auth.requestToken("<>").execute().getAccessToken());

System.out.println(api.guardian().getAuthenticationPolicies().execute());
System.out.println(api.guardian().updateAuthenticationPolicies(Arrays.asList("all-applications")).execute());
System.out.println(api.guardian().getAuthenticationPolicies().execute());
System.out.println(api.guardian().updateAuthenticationPolicies(Arrays.asList()).execute());
System.out.println(api.guardian().getAuthenticationPolicies().execute());

outputs

[]
[all-applications]
[all-applications]
[]
[]

Putting the value to all-applications produces the following image

Checklist