Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-4966

Not able to receive OpenIDClaim and accesstoken in iOS 9.3 with AeroGearOAuth2

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • None
    • None

    Description

      I configured keycloak and iOS app I am able to connect with iOS app to keycloak. (Oauth2.0 aerogear SDK and keycloak 1.9.3)
      After successful login safari browser redirects to app where I should be able to get access token.
      response comes as nil in login call back method.
      Below is the code which I run
      let keycloakConfig = Config(base: "http://kc.dev.com:8080", authzEndpoint: "auth/realms/SharedServices/protocol/openid-connect/auth", redirectURL:"fcapp:/", accessTokenEndpoint: "/auth/realms/SharedServices/protocol/openid-connect/token", clientId: "Mobile",
      refreshTokenEndpoint: "/auth/realms/SharedServices/protocol/openid-connect/token/refresh",
      revokeTokenEndpoint: "/auth/realms/SharedServices/protocol/openid-connect/token/revoke"

      )
      keycloakConfig.isWebView = false

      let http = Http()
      var gdModule = AccountManager.addAccount(keycloakConfig, moduleClass: KeycloakOAuth2Module.self)
      // gdModule = KeycloakOAuth2Module(config: keycloakConfig, session: UntrustedMemoryOAuth2Session(accountId: "ACCOUNT_FOR_CLIENTID_(keycloakConfig.clientId)"))
      http.authzModule = gdModule

      gdModule.login {(accessToken: AnyObject?, claims: OpenIDClaim?, error: NSError?) in

      print(accessToken) // Comes nil how can I get access token??
      print(claims?.description) // Comes nil
      print(error) // comes as errorcode =0
      self.userInfo = claims
      if let userInfo = claims {
      if let name = userInfo.name

      { print(name) }

      }

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            ashish.pandita Ashish Pandita (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: