Performing oauth using Qt

39 views
Skip to first unread message

Doug Bartlett

unread,
Dec 5, 2024, 2:37:57 PM12/5/24
to motorsportreg-api-developers
Has anyone used Qt to access the MotorsportReg.com APIs?  I'm struggling to wrap my head around the terminology and parameters for Qt's OAuth1 class & methods.  A working example would be very helpful.

Doug Bartlett

unread,
Dec 5, 2024, 11:39:48 PM12/5/24
to motorsportreg-api-developers
More specifically, what do I use for the consumerKey and consumerSecret strings in the code snippet below?

    // OAuth1 credentials
    const QString consumerKey = "";
    const QString consumerSecret = "your_consumer_secret";

    // Endpoint URLs
    const QUrl requestTokenUrl(msregBaseUrl + "/rest/tokens/request");
    const QUrl authorizationUrl("https://www.motorsportreg.com/oauth/authorize");
    const QUrl accessTokenUrl(msregBaseUrl + "/rest/tokens/access");

    // QOAuth1 instance
    oauth1.setClientIdentifier(consumerKey);
    oauth1.setClientSharedSecret(consumerSecret);
    oauth1.setTemporaryCredentialsUrl(requestTokenUrl);
    oauth1.setAuthorizationUrl(authorizationUrl);
    oauth1.setTokenCredentialsUrl(accessTokenUrl);


i...@motorsportreg.com

unread,
Dec 18, 2024, 10:02:53 AM12/18/24
to motorsportreg-api-developers
Hi Doug,

To get a consumer key and secret, you'll need to submit a request for credentials via the form on this page: https://info.motorsportreg.com/rest-api-integration 
Reply all
Reply to author
Forward
0 new messages