[Aerogear-users] Not able to receive OpenIDClaim and accesstoken from redirecturi in iOS app

ashish ashishkumarpandita at gmail.com
Fri May 6 04:01:12 EDT 2016


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) }
}
}



--
View this message in context: http://aerogear-users.1116366.n5.nabble.com/Not-able-to-receive-OpenIDClaim-and-accesstoken-from-redirecturi-in-iOS-app-tp639.html
Sent from the aerogear-users mailing list archive at Nabble.com.


More information about the Aerogear-users mailing list