AppAuth-iOS
AppAuth-iOS copied to clipboard
Not able to Logout in the App
guard let issuer = URL(string: Configurations.issuer) else { print("Error creating URL for : (Configurations.LogoutURL)") return }
guard let tokenEndPoint = URL(string: Configurations.tokenEndpoint) else { return }
//let endSessionUrl = issuer.appendingPathComponent("connect/endsession")
guard let authorizationEndpoint = URL(string: Configurations.authenticationEndpoint) else { return }
guard let endSessionEndPoint = URL(string: Configurations.endSessionEndpoint) else { return }
//UIApplication.shared.open(endSessionEndPoint, options: nil, completionHandler: nil)
guard let url1 = URL(string: Configurations.endSessionEndpoint) else { return }
// UIApplication.shared.open(url1)
let config = OIDServiceConfiguration.init(authorizationEndpoint: endSessionEndPoint, tokenEndpoint: endSessionEndPoint, issuer: endSessionEndPoint, registrationEndpoint: nil, endSessionEndpoint: endSessionEndPoint)
let keychainResponse = keychainManager.getAccessToken()
let token = keychainResponse.message
print("token \(token)")
let url = URL(string: Configurations.AuthRedirectURL )!
let endReq = OIDEndSessionRequest.init(configuration: config, idTokenHint: "access_token", postLogoutRedirectURL:url, additionalParameters: nil)
let agent = OIDExternalUserAgentIOS(presenting: presenter)
currentAuthorizationFlow = OIDAuthorizationService.present(endReq, externalUserAgent: agent!) { (response, error) in
if let respon = response
{
print(respon)
}
if let err = error
{
print(err)
}
}
I'm using above code for Logout but it is not working. I'm using App auth 1.4.0 version. x-code version 12.2. Please help me how to do Logout functionality.
@victorynaveen did you solve this issue?