docusign / docusign-objc-client

The Official DocuSign Objective-C Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
13 stars 14 forks source link

The specified Integrator Key was not found or is disabled. #11

Closed dktan closed 4 years ago

dktan commented 6 years ago

Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: unauthorized (401)" UserInfo={NSLocalizedDescription=Request failed: unauthorized (401), DSResponseObject={ errorCode = "PARTNER_AUTHENTICATION_FAILED"; message = "The specified Integrator Key was not found or is disabled. An Integrator key was not specified."; }, NSErrorFailingURLKey=https://demo.docusign.net/restapi/v2/login_information?include_account_id_guid=false&api_password=false&login_settings=none, com.alamofire.serialization.response.error.data=<7b0d0a20 20226572 726f7243 6f646522 3a202250 4152544e 45525f41 55544845 4e544943 4154494f 4e5f4641 494c4544 222c0d0a 2020226d 65737361 6765223a 20225468 65207370 65636966 69656420 496e7465 67726174 6f72204b 65792077 6173206e 6f742066 6f756e64 206f7220 69732064 69736162 6c65642e 20416e20 496e7465 67726174 6f72206b 65792077 6173206e 6f742073 70656369 66696564 2e220d0a 7d>, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x60c000231c20> { URL: https://demo.docusign.net/restapi/v2/login_information?include_account_id_guid=false&api_password=false&login_settings=none } { Status Code: 401, Headers { "Cache-Control" = ( "no-cache" ); "Content-Length" = ( 165 ); "Content-Type" = ( "application/json; charset=utf-8" ); Date = ( "Sun, 17 Dec 2017 22:51:58 GMT" ); "Strict-Transport-Security" = ( "max-age=31536000; includeSubDomains" ); "X-DocuSign-TraceToken" = ( "6cfe47b5-cd21-4a5f-adae-f76eb0c260a1" ); } }}

I'm pretty sure that I have the correct Integrator Key and used it just like the demo code, bug still got this.

maneeshsakthi commented 6 years ago

Hi, Were you able to find any solution for this , i am getting the same issue.

LarryKlugerDS commented 6 years ago

Are you using OAuth authentication or Legacy authentication?

maneeshsakthi commented 6 years ago

Hi Larry,

I am using OAuth, i will give you more information on what i am doing exactly and what are my observtions, I am using DSApiClient's configure_jwt_authorization_flow function , Then i use this client to initialize an DSAuthenticationApi object and then i use this objects loginWithApiPassword method for logging in , in this completion handler i get the above message.

I think the issue is that in the completion block of configure_jwt_authorization_flow i do not get the acess token (The data is empty)

toseefkhilji commented 6 years ago

@dktan, @maneeshsakthi I also got this error.

I was calling configure_jwt_authorization_flow method from background thread. I think this is issue with configure_jwt_authorization_flow method.

Work Around Call API from Main Thread.

let docApi = DSApiClient(baseURL: URL(string: DSConstatns.host))
        docApi.configure_jwt_authorization_flow(DSConstatns.integrationKey, userId: DSConstatns.userId, oauthBasePath: DSConstatns.outhBasePath, privateKeyFilename: DSConstatns.privateKeyName, expiresIn: 3600)

        let authAPI = DSAuthenticationApi(apiClient: docApi)

        let loginOptions = DSAuthenticationApi_LoginOptions()
        loginOptions.loginSettings = "none"
        loginOptions.apiPassword = "true"
        loginOptions.includeAccountIdGuid = "true"

        authAPI?.login(withApiPassword: loginOptions, completionHandler: { (loginInfo, error) in
            if let logInAccount: DSLoginAccount = loginInfo?.loginAccounts.first as? DSLoginAccount {
                debugPrint(logInAccount)
            } else {
                debugPrint(error)
            }
        })

Let me know if you still have question.

jorgeality commented 5 years ago

i have a question Im trying to get the envelopes statuses but i can't get them yet, can someone help me, i am doing test by postman, but i dont know if i should have a header in the petition or something.. please help me thank you

toseefkhilji commented 5 years ago

@jorgeality : Use https://apiexplorer.docusign.com/ for test, if all working fine then try in postman.

LarryKlugerDS commented 4 years ago

Closing this issue. Issue #21 should fix the JWT problem.