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

DSApiClient configure_jwt_authorization_flow threading issue #18

Open toseefkhilji opened 6 years ago

toseefkhilji commented 6 years ago

There are some issue with configure_jwt_authorization_flow method.

  1. It blocks Main thread. (Right now We have to call this on main thread bcz of 2 issue.)

  2. On background thread it gives error #11.

Please find below code:

DispatchQueue.global(qos: .background).async {
            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)
                }
            })
        }
LarryKlugerDS commented 6 years ago

Thank you for the report. A question for you: what is your use case for using this SDK in your project? Are you building a Mac-based application? An iOS application?

If you're building an iOS application, have you checked out our iOS SDK which includes offline signing? Is it missing a feature that you need?

Many thanks, Larry

toseefkhilji commented 6 years ago

@LarryKlugerDS : Thanks for early Reply.

I'm using this SDK for iOS App. My App has embedded signing feature (from create envelope from template to sign) for users who are not registered with docusign.

Yes, I have already checked offline sdk. But I think it does not have Create envelope from a template with Role & create RecipientView features.

because There was already question asked by other user and closed.

Let me know if you still required any information.

toseefkhilji commented 6 years ago

@LarryKlugerDS : Any Updates?

toseefkhilji commented 6 years ago

@LarryKlugerDS : Any Updates?

LarryKlugerDS commented 6 years ago

Hi @toseefkhilji, Please accept my apology, I did not see your July 16 question. The engineering group has been focused on the C#, PHP, Java, and Node.js SDKs due to their heavy usage.

If you can supply a pull request to fix the JWT issue, that would be great.

I have filed DocuSign internal bug ticket, number DCM-2859 Please ask your DocuSign contact to add your organization's information to the bug report.

Unfortunately there is no timetable at this time to fix the issue.

mmallis87 commented 6 years ago

@toseefkhilji Pull requests are accepted and highly appreciated in case you're interested.

toseefkhilji commented 5 years ago

@mmallis87 : I added a pull request #22

toseefkhilji commented 5 years ago

@mmallis87 : Did you get chance to review PR?

LarryKlugerDS commented 4 years ago

I've filed DCM-3816 asking engineering to review the pull request