[GH-ISSUE #712] Does not work with Zotero Oauth #464

Closed
opened 2026-03-03 16:48:51 +03:00 by kerem · 3 comments
Owner

Originally created by @hassanzadeh on GitHub (Jan 15, 2024).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/712

Description:

Tried with Zotero (Oauth v1) but failed with error: The operation couldn’t be completed. (OAuthSwiftError error -10.)

OAuth Provider? (Twitter, Github, ..):

Zotero: https://www.zotero.org/support/dev/web_api/v2/oauth

OAuth Version:

Version 1

OS (Please fill the version) :

  • macOS

Installation method:

  • Swift Package Manager

Library version:

Latest version

Xcode version:

Xcode v15

Swift

Originally created by @hassanzadeh on GitHub (Jan 15, 2024). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/712 ### Description: Tried with Zotero (Oauth v1) but failed with error: The operation couldn’t be completed. (OAuthSwiftError error -10.) ### OAuth Provider? (Twitter, Github, ..): Zotero: https://www.zotero.org/support/dev/web_api/v2/oauth ### OAuth Version: Version 1 ### OS (Please fill the version) : - macOS - ### Installation method: - [ ] Swift Package Manager ### Library version: Latest version ### Xcode version: Xcode v15 Swift
kerem closed this issue 2026-03-03 16:48:51 +03:00
Author
Owner

@hassanzadeh commented on GitHub (Jan 15, 2024):

Here is my code:
`func authenticateWithZotero() {
let oauthswift = OAuth1Swift(
consumerKey: "xxx",
consumerSecret: "zzzz",
requestTokenUrl: "https://www.zotero.org/oauth/request",
authorizeUrl: "https://www.zotero.org/oauth/authorize",
accessTokenUrl: "https://www.zotero.org/oauth/access"
)

                    oauthswift.authorize(
                        withCallbackURL: URL(string: "scholarsync://zotero")!) { result in
                            switch result {
                            case .success(let (credential, _, _)):
                                print(credential.oauthToken)
                                // Save these tokens; they are needed for accessing the API
                            case .failure(let error):
                                print(error.localizedDescription)
                            }
                        }
                }`
<!-- gh-comment-id:1891348935 --> @hassanzadeh commented on GitHub (Jan 15, 2024): Here is my code: `func authenticateWithZotero() { let oauthswift = OAuth1Swift( consumerKey: "xxx", consumerSecret: "zzzz", requestTokenUrl: "https://www.zotero.org/oauth/request", authorizeUrl: "https://www.zotero.org/oauth/authorize", accessTokenUrl: "https://www.zotero.org/oauth/access" ) oauthswift.authorize( withCallbackURL: URL(string: "scholarsync://zotero")!) { result in switch result { case .success(let (credential, _, _)): print(credential.oauthToken) // Save these tokens; they are needed for accessing the API case .failure(let error): print(error.localizedDescription) } } }`
Author
Owner

@phimage commented on GitHub (Jan 15, 2024):

please use correctly markdown

let oauthswift = OAuth1Swift is bad, you do not follow readme and demo code
that cause
-10 > https://github.com/OAuthSwift/OAuthSwift/blob/master/Sources/OAuthSwiftError.swift#L58

<!-- gh-comment-id:1891545780 --> @phimage commented on GitHub (Jan 15, 2024): please use correctly markdown `let oauthswift = OAuth1Swift` is bad, you do not follow readme and demo code that cause -10 > https://github.com/OAuthSwift/OAuthSwift/blob/master/Sources/OAuthSwiftError.swift#L58
Author
Owner

@hassanzadeh commented on GitHub (Jan 15, 2024):

Thanks for your response,
I tested it, it gives me the oauth_token but Not the access_token, is there a specific function I should call to get the access token?

<!-- gh-comment-id:1892860987 --> @hassanzadeh commented on GitHub (Jan 15, 2024): Thanks for your response, I tested it, it gives me the oauth_token but Not the access_token, is there a specific function I should call to get the access token?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#464
No description provided.