openid / openid/AppAuth-iOS

Not able to Logout in the App

Open
#626 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C
Stars
2k
Forks
867
Avg merge
4d 48m
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the shown logout flow and compare its OIDEndSessionRequest, OIDServiceConfiguration, endpoint values, token hint, and redirect URL with the AppAuth 1.4.0 API and the provider's logout requirements. Confirm the external user agent reaches the callback and capture the returned error; done means the provider logout completes and the configured redirect is reached.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
authentication, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.