Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Configuration/Production/OneginiConfigModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
+ (NSArray *)certificates;
+ (NSDictionary *)configuration;

@end
@end
12 changes: 6 additions & 6 deletions Configuration/Production/OneginiConfigModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@

@implementation OneginiConfigModel

// Config model generated by SDK Configurator version: v6.0.0
// Config model generated by SDK Configurator version: v6.0.1

+ (NSArray *)certificates
{
return @[@"MIICnzCCAiWgAwIBAgIQf/MZd5csIkp2FV0TttaF4zAKBggqhkjOPQQDAzBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwHhcNMjMxMjEzMDkwMDAwWhcNMjkwMjIwMTQwMDAwWjA7MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVR29vZ2xlIFRydXN0IFNlcnZpY2VzMQwwCgYDVQQDEwNXRTEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARvzTr+Z1dHTCEDhUDCR127WEcPQMFcF4XGGTfn1XzthkubgdnXGhOlCgP4mMTG6J7/EFmPLCaY9eYmJbsPAvpWo4H+MIH7MA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUkHeSNWfE/6jMqeZ72YB5e8yT+TgwHwYDVR0jBBgwFoAUgEzW63T/STaj1dj8tT7FavCUHYwwNAYIKwYBBQUHAQEEKDAmMCQGCCsGAQUFBzAChhhodHRwOi8vaS5wa2kuZ29vZy9yNC5jcnQwKwYDVR0fBCQwIjAgoB6gHIY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HQ4EFgQUnPtVERBAoj9Fed1cLoJjk0AWR8owHwYDVR0jBBgwFoAUj/BLf6guRSSuTVD6Y5qL3uLdG7wwewYIKwYBBQUHAQEEbzBtMC4GCCsGAQUFBzABhiJodHRwOi8vb2NzcDIuZ2xvYmFsc2lnbi5jb20vcm9vdHIzMDsGCCsGAQUFBzAChi9odHRwOi8vc2VjdXJlLmdsb2JhbHNpZ24uY29tL2NhY2VydC9yb290LXIzLmNydDA2BgNVHR8ELzAtMCugKaAnhiVodHRwOi8vY3JsLmdsb2JhbHNpZ24uY29tL3Jvb3QtcjMuY3JsMCEGA1UdIAQaMBgwCAYGZ4EMAQIBMAwGCisGAQQBoDIKAQMwDQYJKoZIhvcNAQELBQADggEBAAH2bqL3uf9QrGd0o+R5qzRHEsLsXA3Ygc/vwcAjZ3Dzctw2dKfZftQN6PA82HjXzPKM1+FAcjdz5DXQKJqqIBFPFSdQkZknBQDguNQ+zRpI4RnXncmKw1eBJEgSDSxd9EnWqt2OULs0pt67DXzA7ku/kGBitVWEWLmiSjZXfpkVtwSZtNux6Vr92wy9wzBu6Ze/MGRxmhmy6DYlybDsL2pAlRANTtVOVcO0Znq4IaE8UbY8N70nXaqVAlNykgFZogIABeEiY4T3LVDUKC9LOLKiA6ic9ygfVwSb/3wQm3e8raR5jHaoobE+v1dn9rCxc7BFtBwVvbO81i9DsdCnYD4="]; //Base64Certificates
}

+ (NSDictionary *)configuration
{
return @{
@"ONGServerType" : @"access",
@"ONGServerVersion" : @"1.61.0",
@"ONGServerVersion" : @"258eb06",
@"ONGAppIdentifier" : @"ExampleApp",
@"ONGAppPlatform" : @"ios",
@"ONGAppVersion" : @"6.3.4",
@"ONGAppBaseURL" : @"https://mobile-security-proxy.onegini.com",
@"ONGResourceBaseURL" : @"https://mobile-security-proxy.onegini.com/resources/",
@"ONGAppBaseURL" : @"https://mobile-security-proxy.in.test.onewelcome.net",
@"ONGResourceBaseURL" : @"https://mobile-security-proxy.in.test.onewelcome.net/resources/",
@"ONGRedirectURL" : @"oneginiexample://loginsuccess",
};
}

+ (NSString *)serverPublicKey
{
return @"9A52FE40BD781518E3AC53C431FCA96F1E61798C524A7EC36B1F48801A9FAB26";
return @"C8D5F89F5816A8AC05A25463AFC50E7B6E5DC652316D82DEFD4F3F4C3F4294C3";
}

@end
248 changes: 231 additions & 17 deletions OneWelcomeExampleApp.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ class RegistrationErrorDomainMapping {
let title = "Registration error"

switch ONGRegistrationError(rawValue: error.code) {
case .stateless:
let errorDescription = "Stateless registration not available for browser based providers."
let recoverySuggestion = ""
return AppError(title: title, errorDescription: errorDescription, recoverySuggestion: recoverySuggestion)
default:
return AppError(errorDescription: "Something went wrong.")
}
Expand Down
17 changes: 9 additions & 8 deletions OneWelcomeExampleApp/Interactors/RegisterUserInteractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import UIKit

protocol RegisterUserInteractorProtocol: AnyObject {
var identityProviders: [IdentityProvider] { get }
func startUserRegistration(identityProvider: IdentityProvider?)
func startUserRegistration(identityProvider: IdentityProvider?, stateless: Bool)
func handleRedirectURL()
func handleCreatedPin()
func handleTwoStepCode()
Expand Down Expand Up @@ -45,11 +45,10 @@ extension RegisterUserInteractor: RegisterUserInteractorProtocol {
return userClient.identityProviders
}

func startUserRegistration(identityProvider: IdentityProvider?) {
switch AllowedIdentityProviders(rawValue: identityProvider?.identifier ?? "") {
case .stateless, .twoWayStateless:
func startUserRegistration(identityProvider: IdentityProvider?, stateless: Bool) {
if stateless {
userClient.registerStatelessUserWith(identityProvider: identityProvider, scopes: ["read", "openid", "email"], delegate: self)
default:
} else {
userClient.registerUserWith(identityProvider: identityProvider, scopes: ["read", "openid", "email"], delegate: self)
}
}
Expand Down Expand Up @@ -177,10 +176,12 @@ extension RegisterUserInteractor: RegistrationDelegate {
handleSecondStepOfTwoStepRegistration()
case .qrCode:
registerUserPresenter?.presentQRCodeRegistrationView(registerUserEntity: registerUserEntity)
case .stateless, .twoWayStateless:
handleStatelessRegistration(challenge)
default:
registrationNotHandled(challenge)
if userClient.isStateless {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does Example App know about new .isStateless property?
Zrzut ekranu 2025-06-27 o 22 08 03

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look at the note

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've missed the note. So how about rename the PR with prefix Draft:?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but this is not a draft, the PR is finished.

handleStatelessRegistration(challenge)
} else {
registrationNotHandled(challenge)
}
}

}
Expand Down
6 changes: 3 additions & 3 deletions OneWelcomeExampleApp/Presenters/RegisterUserPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protocol RegisterUserInteractorToPresenterProtocol: AnyObject {
}

protocol RegisterUserViewToPresenterProtocol {
func signUp(_ identityProvider: IdentityProvider?)
func signUp(_ identityProvider: IdentityProvider?, stateless: Bool)
func setupRegisterUserView() -> RegisterUserViewController
func handleRedirectURL()
func handleTwoStepCode()
Expand Down Expand Up @@ -113,8 +113,8 @@ extension RegisterUserPresenter: RegisterUserViewToPresenterProtocol {
return registerUserViewController
}

func signUp(_ identityProvider: IdentityProvider? = nil) {
registerUserInteractor.startUserRegistration(identityProvider: identityProvider)
func signUp(_ identityProvider: IdentityProvider? = nil, stateless: Bool) {
registerUserInteractor.startUserRegistration(identityProvider: identityProvider, stateless: stateless)
}

func handleRedirectURL() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import UIKit

class RegisterUserViewController: UIViewController {
@IBOutlet var identityProvidersTableView: UITableView?

@IBOutlet weak var statelessSwitch: UISwitch!

let registerUserViewToPresenterProtocol: RegisterUserViewToPresenterProtocol

var identityProviders = [IdentityProvider]() {
Expand Down Expand Up @@ -47,7 +48,7 @@ class RegisterUserViewController: UIViewController {
}

@IBAction func signUp(_: Any) {
registerUserViewToPresenterProtocol.signUp(nil)
registerUserViewToPresenterProtocol.signUp(nil, stateless: statelessSwitch.isOn)
}
}

Expand All @@ -67,6 +68,6 @@ extension RegisterUserViewController: UITableViewDataSource {
extension RegisterUserViewController: UITableViewDelegate {
func tableView(_: UITableView, didSelectRowAt indexPath: IndexPath) {
let identityProvider = identityProviders[indexPath.row]
registerUserViewToPresenterProtocol.signUp(identityProvider)
registerUserViewToPresenterProtocol.signUp(identityProvider, stateless: statelessSwitch.isOn)
}
}
Loading