-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/mfa integration #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gioraping
wants to merge
45
commits into
ForgeRock:develop
Choose a base branch
from
gioraping:feature/mfa-integration
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 28 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
b3efb25
Add PingOneMFA actionable push notification support to the SDK module…
gioraping 0ecfd9c
fix(PingExample): use iOS 16-compatible .onChange(of:) in PingOneMFAN…
gioraping 585eac3
fix(PingOneMFA): add MFAPushNotification typealias to resolve module/…
gioraping 4ebb157
fix(PingExample): initialize PingOneMFA on demand in didRegisterForRe…
gioraping d3cdc58
fix project files
gioraping f2e1550
fix
gioraping 3120dad
string fixes
gioraping ddcf9eb
uneeded metadata removed
gioraping f47763c
removing config API
gioraping 86f62ec
renaming public SDK api
gioraping b38a1ae
remving reference
gioraping 57fc057
refactoring
gioraping 5a7d46b
added readme file
gioraping 4004d8c
account ui small change
gioraping 977d154
show detailed error messages
gioraping e26db05
documination
gioraping 09c6dc6
added fixes to readme
gioraping e5ccd5c
added link
gioraping 647eaef
fix
gioraping 41bd9b5
Merge branch 'develop' into feature/mfa-integration
gioraping 82ecd8f
api refactor returning list of errors
gioraping 1a975ee
dismissh notification view in case push isCancelAuth
gioraping bd0b0bf
better success message in case of deny
gioraping 1f8d111
refactoring setDeviceToken and getDeviceInfo API
gioraping 3801831
fix inline
gioraping 2fa71a5
fix
gioraping 35d3f58
fix
gioraping a46f8d1
fix
gioraping 59536a7
handle race condition during initialize
gioraping 2c063eb
Add PingOneMFADeviceInfo result type
gioraping d875db2
fixes
gioraping be0a62a
better handling of parsing exceptions
gioraping 6be1c9c
fixes in PingMFAError class
gioraping 1a0e196
tests fixes
gioraping 2be1e5d
test fixes
gioraping 5ba0c2d
readme updated
gioraping 27819d7
fix sample app issues
gioraping b9b507e
fix PushNotification
gioraping 8c0573c
Merge branch 'develop' into feature/mfa-integration
gioraping 2629ab9
fix test
gioraping e108fc3
fix comments
gioraping 7aaec5f
fix
gioraping bee7e2c
fixes in handling push notification flow
gioraping 5e5368b
no message
gioraping 3aa73e1
readme fixes
gioraping File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
PingOneMFA/PingOneMFA.xcodeproj/xcshareddata/IDETemplateMacros.plist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>FILEHEADER</key> | ||
| <string> | ||
| // ___FILENAME___ | ||
| // ___PACKAGENAME___ | ||
| // | ||
| // Copyright (c) ___YEAR___ Ping Identity Corporation. All rights reserved. | ||
| // | ||
| // This software may be modified and distributed under the terms | ||
| // of the MIT license. See the LICENSE file for details. | ||
| // | ||
| </string> | ||
| </dict> | ||
| </plist> |
71 changes: 71 additions & 0 deletions
71
PingOneMFA/PingOneMFA.xcodeproj/xcshareddata/xcschemes/PingOneMFATests.xcscheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <Scheme | ||
| LastUpgradeVersion = "1610" | ||
| version = "1.7"> | ||
| <BuildAction | ||
| parallelizeBuildables = "YES" | ||
| buildImplicitDependencies = "YES" | ||
| buildArchitectures = "Automatic"> | ||
| <BuildActionEntries> | ||
| <BuildActionEntry | ||
| buildForTesting = "YES" | ||
| buildForRunning = "NO" | ||
| buildForProfiling = "NO" | ||
| buildForArchiving = "NO" | ||
| buildForAnalyzing = "YES"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "14C0CBAE9D4D412388F63F45" | ||
| BuildableName = "PingOneMFATests.xctest" | ||
| BlueprintName = "PingOneMFATests" | ||
| ReferencedContainer = "container:PingOneMFA.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildActionEntry> | ||
| </BuildActionEntries> | ||
| </BuildAction> | ||
| <TestAction | ||
| buildConfiguration = "Debug" | ||
| selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| shouldUseLaunchSchemeArgsEnv = "YES" | ||
| shouldAutocreateTestPlan = "YES"> | ||
| <Testables> | ||
| <TestableReference | ||
| skipped = "NO" | ||
| parallelizable = "NO"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "14C0CBAE9D4D412388F63F45" | ||
| BuildableName = "PingOneMFATests.xctest" | ||
| BlueprintName = "PingOneMFATests" | ||
| ReferencedContainer = "container:PingOneMFA.xcodeproj"> | ||
| </BuildableReference> | ||
| </TestableReference> | ||
| </Testables> | ||
| </TestAction> | ||
| <LaunchAction | ||
| buildConfiguration = "Debug" | ||
| selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| launchStyle = "0" | ||
| useCustomWorkingDirectory = "NO" | ||
| ignoresPersistentStateOnLaunch = "NO" | ||
| debugDocumentVersioning = "YES" | ||
| debugServiceExtension = "internal" | ||
| allowLocationSimulation = "YES"> | ||
| </LaunchAction> | ||
| <ProfileAction | ||
| buildConfiguration = "Release" | ||
| shouldUseLaunchSchemeArgsEnv = "YES" | ||
| savedToolIdentifier = "" | ||
| useCustomWorkingDirectory = "NO" | ||
| debugDocumentVersioning = "YES"> | ||
| </ProfileAction> | ||
| <AnalyzeAction | ||
| buildConfiguration = "Debug"> | ||
| </AnalyzeAction> | ||
| <ArchiveAction | ||
| buildConfiguration = "Release" | ||
| revealArchiveInOrganizer = "YES"> | ||
| </ArchiveAction> | ||
| </Scheme> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // | ||
| // AccountParser.swift | ||
| // PingOneMFA | ||
| // | ||
| // Copyright (c) 2025 - 2026 Ping Identity Corporation. All rights reserved. | ||
| // | ||
| // This software may be modified and distributed under the terms | ||
| // of the MIT license. See the LICENSE file for details. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| internal struct AccountParser { | ||
|
|
||
| internal static func parse(_ deviceInfo: [String: Any]?) -> [PingOneMfaAccount] { | ||
| guard let deviceInfo, | ||
| let data = try? JSONSerialization.data(withJSONObject: deviceInfo), | ||
| let decoded = try? JSONDecoder().decode([String: RegionDto].self, from: data) | ||
| else { return [] } | ||
|
|
||
| return decoded.flatMap { region, regionDto in | ||
| regionDto.users.map { user in | ||
| PingOneMfaAccount( | ||
| region: region, | ||
| id: user.id ?? "", | ||
| deviceId: user.device?.id ?? "", | ||
| environmentId: user.environment?.id ?? "", | ||
| name: user.name?.given ?? "", | ||
| family: user.name?.family ?? "" | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private struct RegionDto: Decodable { | ||
| var users: [UserDto] = [] | ||
| } | ||
|
|
||
| private struct UserDto: Decodable { | ||
| var id: String? | ||
| var environment: IdContainer? | ||
| var device: IdContainer? | ||
| var name: NameDto? | ||
| } | ||
|
|
||
| private struct IdContainer: Decodable { | ||
| var id: String? | ||
| } | ||
|
|
||
| private struct NameDto: Decodable { | ||
| var given: String? | ||
| var family: String? | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // | ||
| // PingOneMFAConfig.swift | ||
|
gioraping marked this conversation as resolved.
Outdated
|
||
| // PingOneMFA | ||
| // | ||
| // Copyright (c) 2025 - 2026 Ping Identity Corporation. All rights reserved. | ||
| // | ||
| // This software may be modified and distributed under the terms | ||
| // of the MIT license. See the LICENSE file for details. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| /// Geographic region selector for the PingOneMFA SDK. | ||
| /// | ||
| /// Specifies the PingOne cloud region to connect to. Maps 1:1 to `PingOneSDK.PingOneGeo` | ||
| /// without leaking the upstream module. | ||
| public enum Geo: Sendable, Equatable { | ||
| /// The North America region. | ||
| case northAmerica | ||
| /// The Europe region. | ||
| case europe | ||
| /// The Australia region. | ||
| case australia | ||
| /// The Canada region. | ||
| case canada | ||
| /// The Singapore region. | ||
| case singapore | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // | ||
| // OtpCodeInfo.swift | ||
| // PingOneMFA | ||
| // | ||
| // Copyright (c) 2025 - 2026 Ping Identity Corporation. All rights reserved. | ||
| // | ||
| // This software may be modified and distributed under the terms | ||
| // of the MIT license. See the LICENSE file for details. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| /// A value type representing a one-time passcode with its validity window. | ||
| public struct OtpCodeInfo: Sendable, Equatable { | ||
| /// The current OTP code string to display to the user. | ||
| public let code: String | ||
| /// The number of seconds remaining before this code expires. | ||
| public let secondsRemaining: Int | ||
|
|
||
| /// Creates an `OtpCodeInfo` with the given code and remaining validity. | ||
| /// | ||
| /// - Parameters: | ||
| /// - code: The current OTP code string. | ||
| /// - secondsRemaining: Seconds until the code expires. | ||
| public init(code: String, secondsRemaining: Int) { | ||
| self.code = code | ||
| self.secondsRemaining = secondsRemaining | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // | ||
| // PingOneMFA.h | ||
| // PingOneMFA | ||
| // | ||
| // Copyright (c) 2025 - 2026 Ping Identity Corporation. All rights reserved. | ||
| // | ||
| // This software may be modified and distributed under the terms | ||
| // of the MIT license. See the LICENSE file for details. | ||
|
|
||
|
|
||
| #import <Foundation/Foundation.h> | ||
|
|
||
| //! Project version number for PingOneMFA. | ||
| FOUNDATION_EXPORT double PingOneMFAVersionNumber; | ||
|
|
||
| //! Project version string for PingOneMFA. | ||
| FOUNDATION_EXPORT const unsigned char PingOneMFAVersionString[]; | ||
|
|
||
| // In this header, you should import all the public headers of your framework using statements like #import <PingOneMFA/PublicHeader.h> | ||
|
|
||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.