I am having some trouble using aerogear to connect keycloak locally. I am using shoot example I did the following things
4) I am not able to login to keycloak. I am getting errors in console when keycloak launches the web view can you please help what need to be done to resolve it or guide to proper resource.
@IBAction
func shareWithKeycloak() {
let keycloakConfig =
KeycloakConfig(
clientId:
"shoot-third-party",
host: keycloakHost,
realm:
"shoot-realm")
// If you want to use embedded web view uncomment
keycloakConfig.isWebView =
true
let gdModule =
KeycloakOAuth2Module(config: keycloakConfig, session:
UntrustedMemoryOAuth2Session(accountId:
"ACCOUNT_FOR_CLIENTID_\(keycloakConfig.clientId)"))
// let gdModule = AccountManager.addKeycloakAccount(keycloakConfig)
self.http.authzModule = gdModule
/* gdModule.login { (response, token, error) in
print(response)
print(token)
print(error)
} */
print("Perform photo upload with Keycloak")
self.performUpload("\(keycloakHost)/shoot/rest/photos",
parameters: self.extractImageAsMultipartParams())
}
func performUpload(url:
String, parameters: [String:
AnyObject]?) {
self.http.request(HttpMethod.POST,
path: url, parameters: parameters, credential:
nil, responseSerializer:
nil) { (response, error)
in
if (error !=
nil) {
self.presentAlert("Error", message: error!.localizedDescription)
}
else {
self.presentAlert("Success",
message: "Successfully uploaded!")
}
}
/*
self.http.POST(url, parameters: parameters, completionHandler: {(response, error) in
if (error != nil) {
self.presentAlert("Error", message: error!.localizedDescription)
} else {
self.presentAlert("Success", message: "Successfully uploaded!")
}
})
*/
}