title: Twinfield API OAuth2.0 getaccessToken php-twinfield/twinfield
body: <p>I am currently trying to setup the Twinfield API, it should be pretty straight forward when using the php-twinfield/twinfield library. But there is one thing I don't fully understand.</p>
  <p>Here is my code:</p>
  <pre class="lang-php prettyprint-override"><code>    $provider    = new OAuthProvider([
          'clientId'     =&gt; 'someClientId',
          'clientSecret' =&gt; 'someClientSecret',
          'redirectUri'  =&gt; 'https://example.org/'
      ]);
  
      $accessToken  = $provider-&gt;getAccessToken(&quot;authorization_code&quot;, [&quot;code&quot; =&gt; ...]);
      $refreshToken = $accessToken-&gt;getRefreshToken();
      $office       = \PhpTwinfield\Office::fromCode(&quot;someOfficeCode&quot;);
  
      $connection  = new \PhpTwinfield\Secure\OpenIdConnectAuthentication($provider, 
      $refreshToken, $office);
  </code></pre>
  <p>The $accessToken require something on the dots, some sort of code. I am not sure what that should be...</p>
  <p>I hope someone can help me out. Thanks already!</p>
  <hr />
  <p>I am still stuck with oauth2 setup... the provider seems to have all the information it needs to have. It returns a code which is needed to retrieve an accessToken. But, trying to get one using the following code:</p>
  <pre><code>$accessToken = $provider-&gt;getAccessToken('authorization_code', 
    ['code' =&gt; $_GET['code']]);
  </code></pre>
  <p>This will return 'invalid_grant'.
  I have tried to reset my clientSecret... but that did not help.
  I hope somebody can help me any further.</p>