Hi everybody,
we are currently facing a problem with SAML. We already configured the SMP3 SP8 (OnPremise) to authenticate our iOS-devices against our IDP using the MAFLogonManager.
But because we didn't use the MAFLogonManager for our other applications we also want to implement the SAML configuration by ourself. Before we just implemented a normal registration with HTTP/HTTPS authentication and everything works fine. But with the new SAML implementation we always receive the error:
2015-09-04 17:13:28.247 zgwdemo[26822:1175965] ER:Registration failed with error: Error Domain=HTTPDomainError Code=404 "RegistrationFailed" UserInfo=0x7fe07962e6f0 {NSLocalizedDescription=RegistrationFailed}
2015-09-04 17:13:28.248 zgwdemo[26822:1175965] ER:Registration failed
############ Registration failed ############
Error Domain=MAFLogonCoreErrorDomain Code=3 "Could not connect to the server. Consult with the administrator." UserInfo=0x7fe07962bf40 {NSLocalizedDescription=Could not connect to the server. Consult with the administrator., NSUnderlyingError=0x7fe0796247e0 "RegistrationFailed"}
This is the current implementation of our registration method:
if(state.isRegistered == false){ var error: NSError? = nil var mafContext = logonCore.getContext(&error) if(error == nil){ self.conversationManager = HttpConversationManager() var commonConfig = CommonAuthenticationConfigurator() commonConfig.addSAML2ConfigProvider(self) commonConfig.configureManager(self.conversationManager) var registrationContext = mafContext.registrationContext registrationContext.applicationId = "XXXXXXX" registrationContext.serverHost = "XXXXXX" registrationContext.domain = "default" registrationContext.serverPort = 443 registrationContext.isHttps = true registrationContext.backendUserName = txtUsername.text registrationContext.backendPassword = txtPasswort.text //Erweiterung von SAML var regConfig = NSMutableDictionary() var contextAuth = NSMutableArray() var authConfig = NSMutableDictionary() var config = NSMutableDictionary() authConfig.setObject(config, forKey: "config") authConfig.setObject("saml2.web.post", forKey: "type") config.setObject("com.sap.cloud.security.login", forKey: "saml2.web.post.authchallengeheader.name") config.setObject("/SAMLAuthLauncher", forKey: "saml2.web.post.finish.endpoint.uri") config.setObject("finishEndpointParam", forKey: "saml2.web.post.finish.endpoint.redirectparam") contextAuth.addObject(authConfig) regConfig.setObject(contextAuth, forKey: "keyMAFLogonRegistrationContextAuth") var currentConfig = logonCore.defaultValues var defaultValuesDict: NSMutableDictionary = currentConfig().objectForKey("keyMAFLogonOperationContextDefaultValues") as! NSMutableDictionary defaultValuesDict.setObject(regConfig, forKey: "keyMAFLogonRegistrationContextConfig") logonCore.setDefaultValues(defaultValuesDict) self.logonCore.logonCoreDelegate = self self.logonCore.registerWithContext(mafContext) }else{ println(error?.description) }
I'm not sure if I'm completely wrong but in my understanding is that I have to connect the conversationManager with the logonCore. Like you have to do it when you use the MAFLogonManager:
self.logonManager.logonConfigurator.configureManager(self.conversationManager)
Does anyone has the same problem or already has the solution for SAML authentication without using the MAFLogonManager?
Thanks in advance
Stephan