[Aerogear-users] AeroGear SDK integration with Keycloak

Daniel Passos dpassos at redhat.com
Thu Apr 28 12:01:02 EDT 2016


Hi

Are you getting this error when you are firing a request to KC server from
your app?

```

17:01:31,549 ERROR [org.jboss.resteasy.resteasy_jaxrs.i18n] (default
task-1) RESTEASY002010: Failed to execute:
javax.ws.rs.NotFoundException: HTTP 404 Not Found

```

I'm not 100% sure (didn't have time to test) but I think the problem is, KC
1.9.1 are using different endpoints and the iOS app was not updated yet.

Our cookbook backend[1] was updated to 1.9.1 by the community[2] weeks ago

Unfortunately he updated only the Android app[3] to the new endpoints

Can you check the Android PR[3] and see if you change that in the iOS app
it works?

[1] https://github.com/aerogear/aerogear-backend-cookbook/tree/master/Shoot
[2] https://github.com/aerogear/aerogear-backend-cookbook/pull/29
[3] https://github.com/aerogear/aerogear-android-cookbook/pull/56







On Thu, Apr 28, 2016 at 8:44 AM, Ashish Pandita <Ashish.Pandita at indegene.com
> wrote:

> Hi All,
>
> I am having some trouble using aerogear to connect keycloak locally. I am
> using shoot example I did the following things
> 1) installed pods on shoot&share
> https://github.com/aerogear/aerogear-ios-cookbook/tree/0.3.0/Shoot
> 2) installed the key cloak ver keycloak-1.9.2.Final (
> https://github.com/aerogear/aerogear-backend-cookbook/tree/master/Shoot)
> I can access the admin console in browser imported the realm configuration
> https://github.com/aerogear/aerogear-backend-cookbook/blob/master/Shoot/configuration/shoot-realm.json
> 3) I run the server attached is the log and here is the terminal rec
> https://asciinema.org/a/7xhosmb63kn9tnvn99gnh5mbm
> 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.
>
> here is the Aerogear API which I am using
>
>  @IBAction func shareWithKeycloak() {
>
>
>         let keycloakHost = "http://localhost:8080"
>         let keycloakConfig = KeycloakConfig(
>             clientId: "shoot-third-party",
>             host: keycloakHost,
>             realm: "shoot-realm")
>         // If you want to use embedded web view uncomment
>           keycloakConfig.isWebView = true
>
>
>         // Workaround issue on Keychain
> https://forums.developer.apple.com/message/23323
>         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!")
>             }
>         })
>
>
>             */
>     }
>
>
>
> Disclaimer : This message and any attachments are solely for the intended
> recipient and may contain confidential or privileged information. If you
> are not the intended recipient, any disclosure, copying, use, or
> distribution of the information included in this message and any
> attachments is prohibited. If you have received this communication in
> error, please notify us by reply e-mail to IT at Indegene.com and
> immediately and permanently delete this message and any attachments. Any
> views expressed in this mail are not necessarily the views of INDEGENE.
> Thank you.
>
> _______________________________________________
> Aerogear-users mailing list
> Aerogear-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-users
>
>


-- 
-- Passos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-users/attachments/20160428/87a35cdc/attachment.html 


More information about the Aerogear-users mailing list