react-native-auth0
react-native-auth0 copied to clipboard
Allow additional options for authorize and support custom LAPolicy
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
- [x] I have read the Auth0 general contribution guidelines
- [ ] All existing and new tests complete without errors
- [ ] All active GitHub checks have passed
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 updated to use https://github.com/auth0/react-native-auth0/pull/542 for the options param I fixed here.
Hey Guys, Is there any update on this ticket. We are also looking for an additional input to control the LAPolicy.