[GH-ISSUE #262] OAuth1 is crashed (on self access) #153

Closed
opened 2026-03-03 16:46:10 +03:00 by kerem · 1 comment
Owner

Originally created by @NightBlaze on GitHub (Aug 8, 2016).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/262

I use OAuthSwift to connect to Upwork API https://developers.upwork.com
Trying to authenticate

func authenticate() {
    let oauthswift = OAuth1Swift(
        consumerKey:     "key",
        consumerSecret:  "secret",
        requestTokenUrl: "https://www.upwork.com/api/auth/v1/oauth/token/request",
        authorizeUrl:    "https://www.upwork.com/services/api/auth",
        accessTokenUrl:  "https://www.upwork.com/api/auth/v1/oauth/token/access"
    )
    oauthswift.authorizeWithCallbackURL(
        NSURL(string: "my-scheme-upwork://oatuh-upwork")!,
        success: { credential, response, parameters in
            print(credential.oauth_token)
            print(credential.oauth_token_secret)
            print(parameters["user_id"])
        },
        failure: { error in
            print(error.localizedDescription)
        }             
    )
}

And I get the crash
https://s10.postimg.org/al6csjjtl/2016_08_08_10_37_24.png

  • OS targeted (with version): ??
    iOS 9.0
  • OAuth provider: ??
    Upwork
  • OAuthSwift version: previous/last release, master head???
    0.6.0
Originally created by @NightBlaze on GitHub (Aug 8, 2016). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/262 I use OAuthSwift to connect to Upwork API https://developers.upwork.com Trying to authenticate ``` func authenticate() { let oauthswift = OAuth1Swift( consumerKey: "key", consumerSecret: "secret", requestTokenUrl: "https://www.upwork.com/api/auth/v1/oauth/token/request", authorizeUrl: "https://www.upwork.com/services/api/auth", accessTokenUrl: "https://www.upwork.com/api/auth/v1/oauth/token/access" ) oauthswift.authorizeWithCallbackURL( NSURL(string: "my-scheme-upwork://oatuh-upwork")!, success: { credential, response, parameters in print(credential.oauth_token) print(credential.oauth_token_secret) print(parameters["user_id"]) }, failure: { error in print(error.localizedDescription) } ) } ``` And I get the crash ![https://s10.postimg.org/al6csjjtl/2016_08_08_10_37_24.png](https://s10.postimg.org/al6csjjtl/2016_08_08_10_37_24.png) - **OS targeted (with version):** ?? iOS 9.0 - **OAuth provider:** ?? Upwork - **OAuthSwift version:** previous/last release, master head??? 0.6.0
kerem 2026-03-03 16:46:10 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@phimage commented on GitHub (Aug 8, 2016):

your oauthswift object is no more in memory I think ( self cannot be acceded)
keep it as variable of your class

N.B. maybe I can change unowned to weak for self
then document in readme or generated doc to not release OAuthSwift object

<!-- gh-comment-id:238179295 --> @phimage commented on GitHub (Aug 8, 2016): your oauthswift object is no more in memory I think ( self cannot be acceded) keep it as variable of your class N.B. maybe I can change unowned to weak for self then document in readme or generated doc to not release OAuthSwift object
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#153
No description provided.