Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no authCode property on web mode #1

Closed
indra1 opened this issue Jan 3, 2019 · 5 comments
Closed

no authCode property on web mode #1

indra1 opened this issue Jan 3, 2019 · 5 comments

Comments

@indra1
Copy link

indra1 commented Jan 3, 2019

I'm trying to implement this package in top of laravel. I have installed this package using composer and all seams well when using the properties from example.php. However I get a link to authorize the app that gives me an error when that happens.

So I went through the code provided here and I figured out I need to use web mode so I did this:

$config = new \Upwork\API\Config(
    		[
		        'clientId'          => config('upwork.cutomer_key'), // SETUP YOUR CONSUMER KEY
        		'clientSecret'      => config('upwork.customer_secret'), // SETUP KEY SECRET
			'redirectUri'       => 'https://example.com/redirect', // my actual url here
		        'accessToken'       => '', // WARNING: keep this up-to-date!
		        'refreshToken'      => '', // WARNING: keep this up-to-date!
		        'expiresIn'         => '', // WARNING: keep this up-to-date!
		        'mode'              => 'web',
		        'debug'             => true
    	]);    	

However I get this error now, and I think the issue is there is no suthCode property anywhere in your code, but somehow it's used somewhere?

preparing Client.
starting Upwork\API\AuthTypes\AbstractOAuth authentication.
authing Client.

Upwork\API\ApiException : Wrong property name requested.

at \vendor\upwork\php-upwork-oauth2\src\Upwork\API\Config.php:124
120| {
121| $name = '_' . $option;
122|
123| if (!property_exists('Upwork\API\Config', $name)) {

124| throw new ApiException('Wrong property name requested.');
125| }
126|
127| return self::$$name;
128| }

Exception trace:

1 Upwork\API\Config::get("authCode")
\vendor\upwork\php-upwork-oauth2\src\Upwork\API\Client.php:105

2 Upwork\API\Client::auth()
\app\Http\Controllers\GetJobsController.php:27

@mnovozhylov
Copy link
Contributor

mnovozhylov commented Jan 3, 2019

Hello @indra1 ,

thank you for your interest in this library. Currently, OAuth2 is in beta phase, and it looks like you are using an OAuth1 key to access OAuth2 functionality.

Please, contact our Support Team and provide all the details. So, they can assist you accordingly.

P.S. if you're looking for PHP OAuth1 library to access Upwork API, please check here

Wbr

@indra1
Copy link
Author

indra1 commented Jan 4, 2019

This is literally copy paste from your example code of auth2.

@mnovozhylov
Copy link
Contributor

@indra1 , please, contact our Support Team and provide the key you use in this example and other data.

@janzikmund
Copy link

How come this has been closed? I have the exact same issue as @indra1 points out, and obviously this hasn't been fixed in three years. Enabling web mode just throws the error exactly as pointed in the first post.

@janzikmund
Copy link

#12 - pull request to fix on latest version 2.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants