title: sending issue to bitbucket using oauth via bitbucket api
body: <p>i have read this related question;
  <a href="https://stackoverflow.com/questions/12336777/request-oauth-token-from-bitbucket">Request OAuth token from BitBucket</a></p>
  <p>in that question above , it uses curl . but there must be a way to do it with gentlero-api
  because it has php class in it about oauth.</p>
  <pre><code>    $bb_user = 'myuser_name';
      $bb_pass = 'mypasss';
      $account_name = 'account_name';    
      $repo_slug = 'repo_name';
  
      $issue = new  issues();
      $issue-&gt;setCredentials( new Basic($bb_user, $bb_pass) );   
  
      // iwanna do something like.  but how??
      //  $issue-&gt;setCredentials( new Oauth($key, $secret) );     
    
  
      $issue-&gt;create($account_name, $repo_slug, array(
          'title'     =&gt; 'konu',
          'content'   =&gt; 'içerik metin 123123',
          'kind'      =&gt; 'proposal',
          'priority'  =&gt; 'blocker'
          ));
  </code></pre>
  <p>i want to do oauth like that simple but. i coudnt find any good resouce.</p>
  <p><strong>edit:</strong></p>
  <p>//i did it with <strong>basic auth</strong> like this.
  <a href="https://github.com/gentlero/bitbucket-api/blob/master/docs/repositories/issues.md" rel="nofollow noreferrer">https://github.com/gentlero/bitbucket-api/blob/master/docs/repositories/issues.md</a></p>
  <pre><code>//prepare 
  $issue = new Bitbucket\API\Repositories\Issues();
  $issue-&gt;setCredentials( new Bitbucket\API\Authentication\Basic($bb_user, $bb_pass) );
  
  //create new issue
  $issue-&gt;create($account_name, $repo_slug, array(
      'title'     =&gt; 'dummy title',
      'content'   =&gt; 'dummy content',
      'kind'      =&gt; 'proposal',
      'priority'  =&gt; 'blocker'
  ));
  </code></pre>
  <p>and there is this too; this code does oauth.</p>
  <pre><code>// OAuth 1-legged example
  // You can create a new consumer at:  account/user/&lt;username or team&gt;/api
  $oauth_params = array(
      'oauth_consumer_key'      =&gt; 'aaa',
      'oauth_consumer_secret'   =&gt; 'bbb'
  );
  
  $user = new Bitbucket\API\User;
  $user-&gt;getClient()-&gt;addListener(
      new Bitbucket\API\Http\Listener\OAuthListener($oauth_params)
  );
  
  // now you can access protected endpoints as consumer owner
  $response = $user-&gt;get();
  </code></pre>
  <p>what i want to do is   copying user's auth  and giving the auth to issue, something like this.</p>
  <pre><code>$credss  = $user-&gt;getcredenditals();
  $issue-&gt;setCredentials( $credss  ) ;
  </code></pre>
  <p><strong>EDIT:</strong> I learned form gazaret answer what to do. Here is the working code of mine</p>
  <pre><code>public function createIssue()
  {
      $account_name = 'companyy';    
      $repo_slug = 'issuer';
  
      $oauth_params = array(
          'oauth_consumer_key'      =&gt; 'key',
          'oauth_consumer_secret'   =&gt; 'secret'
      );
  
      $issue = new issues();
      //this was the missing peace of the puzzle . one single line
      $issue-&gt;getClient()-&gt;addListener( new OAuthListener($oauth_params) );
      
      $issue-&gt;create($account_name, $repo_slug, array(
          'title'     =&gt; 'konu o_authlu',
          'content'   =&gt; 'içerik metin 123123',
          'kind'      =&gt; 'proposal',
          'priority'  =&gt; 'blocker'
          ));
      
      return;
  
  }
  </code></pre>