Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9123511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:21:29+00:00 2026-06-17T06:21:29+00:00

Looking at Dwolla’s API documentation and trying the oauth.php example code (code shown below)

  • 0

Looking at Dwolla’s API documentation and trying the oauth.php example code (code shown below) on my site it is not clear to me if I can generate an access token without redirecting to Dwolla’s page.

Redirecting from my site to their site back to my site is really terrible from a UI/UX perspective and is no better than the crappy interface Paypal provides.

Does anyone know how to generate a Dwolla access token using AJAX?

<?php
// Include the Dwolla REST Client
require '../lib/dwolla.php';

// Include any required keys
require '_keys.php';

// OAuth parameters
$redirectUri = 'http://localhost:8888/oauth.php'; // Point back to this file/URL
$permissions = array("Send", "Transactions", "Balance", "Request", "Contacts",   "AccountInfoFull", "Funding");

// Instantiate a new Dwolla REST Client
$Dwolla = new DwollaRestClient($apiKey, $apiSecret, $redirectUri, $permissions);

/**
 * STEP 1: 
 *   Create an authentication URL
 *   that the user will be redirected to
 **/

if(!isset($_GET['code']) && !isset($_GET['error'])) {
$authUrl = $Dwolla->getAuthUrl();
header("Location: {$authUrl}");
}

/**
 * STEP 2:
 *   Exchange the temporary code given
 *   to us in the querystring, for
 *   a never-expiring OAuth access token
 **/
 if(isset($_GET['error'])) {
echo "There was an error. Dwolla said: {$_GET['error_description']}";
}

else if(isset($_GET['code'])) {
$code = $_GET['code'];

$token = $Dwolla->requestToken($code);
if(!$token) { $Dwolla->getError(); } // Check for errors
else {
    session_start();
    $_SESSION['token'] = $token;
    echo "Your access token is: {$token}";
} // Print the access token
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:21:30+00:00Added an answer on June 17, 2026 at 6:21 am

    TL;DR – No, that’s not how OAuth works


    The whole point of the OAuth scheme is authentication on the website of the service that you want to use, in this case, Dwolla. By forcing the user to go to their page it ensures a few things:

    1. The user is made aware that they are using an external service whose terms of service may be different than your application
    2. The user is made aware of the features requested by your application for that service. In dwolla’s case there are different levels of functionality that can be requested by your application including transferring of money, so it’s important that your users are aware of that!

    You can read up more on OAuth at http://oauth.net/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking through the documentation , it seems that the new advanced gestures API doesn't
Looking to develop a web service (api) in PHP to offer customers an easier
Looking through some java code and this just does not seem right. To me,
Looking at some assembly code for x86_64 on my Mac, I see the following
Looking at the Ehcahce implementation of net.sf.cache.JS107, I am trying to achieve the following
Looking at some of the code System.Linq I've come across some examples of Buffer<TSource>
Looking for recommendations and some reference code for encrypting byte array in C. The
Looking at the code: int i = 5; if (i = 0) { printf
Looking a solution for strange JTDS error message: Could not find a Java charset
Looking for a regexp sequence of matches and replaces (preferably PHP but doesn't matter)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.