react-native-auth0 icon indicating copy to clipboard operation
react-native-auth0 copied to clipboard

Allow additional options for authorize and support custom LAPolicy

Open chrismcleod opened this issue 3 years ago • 1 comments

Changes

  • Fix issue passing other configuration options to authorize call
  • Fix issue where iOS enableLocalAuthentication uses title parameter for all properties instead of the correct paramters
  • Consume ability to specify LA policy (to fallback to passcode for example)

New usage for custom evaluation policy on iOS:

import {useAuth0, LAPolicy} from 'react-native-auth0'

const { requireLocalAuthentication } = useAuth0()

requireLocalAuthentication(
  'title',
  'description',
  'cancel',
  'fallback',
   LAPolicy.deviceOwnerAuthentication // Biometric or device passcode
);

Testing

  • [x] This change adds unit test coverage
  • [x] This change has been tested on the latest version of the platform/language or why not

What to test

  • Pass different values for title, description, cancel, fallback. Test FaceID on iOS device. See the different titles are used in the system FaceID UI (they were all title before)

  • Pass ephemeralSession: true to the 2nd set of options for authorize call. See iOS does not prompt to login with auth0.

  • Pass LAPolicy.deviceOwnerAuthentication for the new 5th parameter to requireLocalAuthentication. Test that FaceID falls back to device passcode for iOS.

Checklist

chrismcleod avatar Oct 09 '22 21:10 chrismcleod

Hi @chrismcleod thanks a lot for your contribution and this looks like a really neat work. I am discussing with our team about this and will get back to you about this PR soon

poovamraj avatar Oct 18 '22 10:10 poovamraj

@poovamraj updated to use https://github.com/auth0/react-native-auth0/pull/542 for the options param I fixed here.

chrismcleod avatar Oct 28 '22 16:10 chrismcleod

Hey Guys, Is there any update on this ticket. We are also looking for an additional input to control the LAPolicy.

ajamthe avatar Jan 19 '23 05:01 ajamthe