Repository navigation
Conversation
…xternal-idp(SDKS-5452)
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
| var handled = LoginManager.shared.application(application, open: url, options: options) | ||
| #if canImport(PingExternalIdPFacebook) | ||
| handled = FacebookHandler.handleOpenURL(application, url: url, options: options) | ||
| handled = FacebookHandler.handleOpenURL(application, url: url, options: options) || handled |
There was a problem hiding this comment.
Mend Code Security Check
New finding (1 of 1)
The Mend Code Security Check of your branch failed because of a External URL Access finding in this line.
Codecov Report❌ Patch coverage is ❌ Your project check has failed because the head coverage (73.72%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #88 +/- ##
============================================
+ Coverage 72.14% 73.72% +1.57%
- Complexity 252 292 +40
============================================
Files 217 174 -43
Lines 26343 25102 -1241
Branches 1215 763 -452
============================================
- Hits 19006 18507 -499
+ Misses 7165 6531 -634
+ Partials 172 64 -108
... and 47 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
| "android": "react-native run-android", | ||
| "ios": "react-native run-ios", | ||
| "ios:build": "xcodebuild -workspace ios/PingSampleApp.xcworkspace -scheme PingSampleApp -configuration Debug -destination 'generic/platform=iOS Simulator' -derivedDataPath ios/build build", | ||
| "ios:install": "xcrun simctl install booted ios/build/Build/Products/Debug-iphonesimulator/PingSampleApp.app && xcrun simctl launch booted com.pingidentity.rnsampleapp.oidc", |
There was a problem hiding this comment.
Nice addition, this makes the Xcode 27 workflow much easier to follow. One small thing: the launch step uses com.pingidentity.rnsampleapp.oidc, but the app's PRODUCT_BUNDLE_IDENTIFIER is com.pingidentity.rnsampleapp (see project.pbxproj). The .oidc suffix only appears as a storage account string in src/clients.ts, so unless I'm missing something, simctl launch won't find an app with that ID and yarn ios:build-run will fail at the last step after a successful build and install.
| "ios:install": "xcrun simctl install booted ios/build/Build/Products/Debug-iphonesimulator/PingSampleApp.app && xcrun simctl launch booted com.pingidentity.rnsampleapp.oidc", | |
| "ios:install": "xcrun simctl install booted ios/build/Build/Products/Debug-iphonesimulator/PingSampleApp.app && xcrun simctl launch booted com.pingidentity.rnsampleapp", |
| val loginIntent = LineLoginApi.getLoginIntent(activity, channelId, params) | ||
|
|
||
| suspendCancellableCoroutine { continuation -> | ||
| val launcher = activity.activityResultRegistry.register( |
There was a problem hiding this comment.
Thanks for documenting the lifecycle limitation in the KDoc, that's really helpful for anyone copying this. One small note on the rotation case it mentions: MainActivity declares configChanges for orientation|screenSize|... in the manifest, so rotation shouldn't recreate the activity in this app. What's left is mainly the "Don't keep activities" developer option, or config changes that aren't in that list (locale, density, font scale) while the LINE UI is in the foreground. In those cases the registry callback is gone and the coroutine never resumes, so the JS promise stays pending.
Non-blocking, and perfectly fine to leave as-is for a sample. If you'd like to harden it cheaply, cancelling the continuation when the activity is destroyed would let the call fail fast instead of waiting indefinitely. It may also be worth tweaking the KDoc so it doesn't list rotation as a trigger.
| options: [UIApplication.OpenURLOptionsKey: Any] = [:] | ||
| ) -> Bool { | ||
| var handled = false | ||
| var handled = LoginManager.shared.application(application, open: url, options: options) |
There was a problem hiding this comment.
Small, non-blocking suggestion. LoginManager.shared.application(_:open:options:) now sees every incoming URL. In the LINE SDK (5.17.0), LoginProcess.resumeOpenURL fails the in-flight login with callbackURLSchemeNotMatching for any URL that isn't a LINE callback, so an unrelated deep link arriving while a LINE login is open would end that login. Previously unknown URLs just fell through and returned false.
It's probably rare in practice, but a cheap guard keeps LINE out of the way for other URLs:
var handled = false
if url.scheme?.hasPrefix("line3rdp.") == true {
handled = LoginManager.shared.application(application, open: url, options: options)
}(LINE also checks that the URL host is authorize, but the scheme check is enough as a pre-filter.)
Summary
Adds a native-only custom IdP handler registry to
@ping-identity/rn-external-idpso apps can support social providers beyond the built-in apple/siwa/google/facebook set (for example LINE or WeChat). App code implements the native SDK'sIdpHandlerinterface and registers it by provider name at startup; the Journey authorize path resolves through the registry first and falls back to the untouched native built-ins. No JS API, TurboModule, or client-configuration changes: existingselectProviderForJourney/authorizeForJourneycalls route to the custom handler whenever the callback's provider value matches.Changes
IdpHandlerRegistry(process-scopedConcurrentHashMap, trimmed-lowercase keys, replace-on-re-register) andRNPingExternalIdpCommon.registerIdpHandler()forApplication.onCreate. Registration rejects blank names and any name containing a reserved built-in token (apple,siwa,google,facebook,fb-limited) so a custom handler can never shadow a built-in route.com.pingidentity.sdks:external-idpmoves fromimplementationtoapiscope so the nativeIdpHandlertypes resolve from app code.NSLock-guarded registry with the same normalization and reserved-token list;registerIdpHandler(_:handler:)is Swift-only (non-@objc) because the native protocol is not@objc;IdpHandlerRegistrationErrorconforms toLocalizedErrorso reasons reachlocalizedDescription.RedirectUriOverridingIdpHandler(Android; iOS reuses its existing wrapper) rewritesIdpClient.redirectUriwith the JS-configured value before delegating, because nativeauthorize()builds the client from the callback's own server-supplied redirect URI.line: AndroidLineIdpHandler+LineLoginBridge(linesdk 5.13.0), iOSLineIdpHandler(LineSDKSwift ~> 5.9, Info.plist URL schemes, open-URL wiring). Newios:build-runscripts and an Xcode 27 note in the app README.StubIdpHandler(Kotlin + Swift) registered asstubprovider, proving app code can implement the interface and thatimport PingExternalIdPresolves transitively on iOS with no Podfile entry.@ping-identity/rn-external-idpminor.Platform notes
authorizeForDaVincidoes not consult the registry.EXTERNAL_IDP_CONFIG_ERROR(native throwsIllegalArgumentException("Unsupported provider: ...")), iOSEXTERNAL_IDP_UNSUPPORTED_PROVIDER.additionalParametersreturned by a handler are replayed as request parameters onjourney.next(), so they are server-visible; documented in the README.PingTestRunner/ios/Podfile.lockcontains checksum-only churn from a validation pod install (no version changes).Verification