if (!empty($_POST['twitnam'])) { $message = $_POST['message']; $TwitterUsername = $_POST['twitnam']; $tw_sql = mysqli_query($connection, "SELECT oauth_token,oauth_token_secret FROM TwitterUpdate WHERE uname='$TwitterUsername'"); $row = mysqli_fetch_array($tw_sql, MYSQLI_ASSOC); $oauth_token = $row["oauth_token"]; $oauth_token_secret = $row["oauth_token_secret"]; if (strlen($oauth_token) > 0 && strlen($oauth_token_secret) > 0) { $Twitter = new EpiTwitter($consumer_key, $consumer_secret); $Twitter->setToken($oauth_token, $oauth_token_secret); $status = $Twitter->post_statusesUpdate(array('status' => $message)); echo $status->id_str; } } every time i try to run the script i got: Fatal error: Uncaught exception 'EpiTwitterNotAuthorizedException' with message '{"errors":[{"message":"Could not authenticate you","code":32}]}' in /****/EpiTwitter/EpiTwitter.php:254 Stack trace: #0 /*****/EpiTwitter/EpiTwitter.php(217): EpiTwitterException::raise(Object(EpiCurlManager), false) #1 /*****/EpiTwitter/EpiTwitter.php(118): EpiTwitterJson->__get('response') #2 /******/EpiTwitter/EpiTwitter.php(100): EpiTwitter->request('POST', '/statuses/updat...', Array) #3 /*****/fbmain.php(98): EpiTwitter->__call('post_statusesUp...', Array) #4 /*****/fbmain.php(98): EpiTwitter->post_statusesUpdate(Array) #5 /****/index.php(17): in …

Member Avatar
Member Avatar
+0 forum 2

# What is OAuth and why do I want to use it? If you want to write an application that caters to existing members of a service, and you want your application to be able to access private areas of your end-users' profiles, or modify their accounts on their behalf, then you need OAuth. OAuth allows your application to automatically detect which member is using it without the member having to share anything about themselves. Additionally, it allows your application to authenticate itself to a service API with the member credentials of an end-user who is using it, without the …

Member Avatar
Member Avatar
+4 forum 8

# The nature of this tutorial ... This tutorial is designed to walk you through DaniWeb's implicit (clientside) OAuth flow. This is not designed to be an introductory tutorial to OAuth, and we will expect that you are already familiar with the nature of OAuth and/or have read our tutorial on [Getting started with OAuth 2.0 Explicit Flow](http://www.daniweb.com/web-development/php/tutorials/469804/getting-started-with-oauth-2.0-explicit-flow). The implicit flow allows you to acquire an access token and access the API entirely from within a browser-based javascript application. While this tutorial is specific to DaniWeb's API, we do adhere to OAuth standards, and so the flow should not be …

Member Avatar
+2 forum 0

prompted by the discussion on antoher thread... This has stopped working (jQuery/OAuth): http://dw.diafol.org/en/dw-box/ Although this still works (php/no OAuth): http://dw.diafol.org/en/dw-badge/ When I start the ball rolling with a click on the jQuery example, I get the authentication box and nothing else. Subsequent clicks bring up the box again.

Member Avatar
Member Avatar
+0 forum 26

Hi Dani, AFAIK OAuth 2.0 supports 3 flavours: Server side apps, client side apps and installed apps. Does Daniweb Oauth allow OOB in the redirect_uri which is part of the support for installed/standalone apps? If no, are you expecting desktop app writers to spawn a local web server and use the serverside flow?

Member Avatar
Member Avatar
+0 forum 21

I want to write a script that logs an user into Facebook and initialize oauth dialog to get the access_token(*I don't want to log in into a website using facebook account!*). I don't want to use facebook-sdk,pyfb etc. This is what I've tried: import sys, urllib2,json,urlparse,webbrowser, os, cookielib, re class Facebook(): def __init__(self, email, password): self.email = email self.password = password cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) opener.addheaders = [('Referer', 'http://login.facebook.com/login.php'), ('Content-Type', 'application/x-www-form-urlencoded'), ('User-Agent', 'Mozilla/8.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) \ Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)')] self.opener = opener def login(self): url = 'https://login.facebook.com/login.php?login_attempt=1' data ="locale=en_US&non_com_login=&email="+self.email+"&pass="+self.password+"&lsd=20TOl" usock = …

Member Avatar
+0 forum 0

Maybe I'm just being dense, but I'm using [this documentation](https://developers.google.com/accounts/docs/OAuth2Login#sendauthrequest) to use Google OAuth 2 login. I'm able to successfully retrieve a JSON array that consists of the access_token, id_token, etc. The id_token is encrypted in what google calls a JWT (JSON Web Token). From what I understand, they're base 64 encoded, but base64_decode() in PHP is just giving me gibberish. What am I doing wrong??

Member Avatar
Member Avatar
+0 forum 5

OK, as promised, here's an updated 'quick(!) and dirty' class for retrieving and setting data via the Daniweb API. It allows the extraction of data based around: # DATA RETRIEVAL & SETTING # ## non-OAuth ## * forums * articles * posts * members * activity points * endorsements * reputation ## OAuth (requires client_id and secret key) ## * who am i? (**me** - more data than from non-OAuth members) * articles (expansion of non-OAuth articles) * watched articles (watch and unwatch) * voting on posts (upvote and downvote) * PMs **(currently inactive)** ## Direct URL retrieval ## * …

Member Avatar
Member Avatar
+2 forum 2

Hello guyz, I am trying call oauth/request_token in order to oauth_token and oauth_token_secret. First here's the code string url = "https://api.twitter.com/oauth/request_token"; SortedDictionary<string,string> sd = new SortedDictionary<string,string>(); sd.Add("oauth_callback",oauth_callback); sd.Add("oauth_consumer_key",oauth_consumer_key); sd.Add("oauth_nonce",oauth_nonce); sd.Add("oauth_signature_method",oauth_signature_method); sd.Add("oauth_timestamp", oauth_timestamp); sd.Add("oauth_version",oauth_version); string base_string = String.Empty; base_string += "POST" + "&"; base_string += Uri.EscapeDataString("https://api.twitter.com/oauth/request_token")+"&"; foreach (KeyValuePair<string,string> entry in sd) { base_string += Uri.EscapeDataString(entry.Key+"="+entry.Value+"&"); } base_string = base_string.Substring(0,base_string.Length-3); var compositeKey = string.Concat(Uri.EscapeDataString(oauth_consumer_secret), "&"); string oauth_signature; using (HMACSHA1 hasher = new HMACSHA1(ASCIIEncoding.ASCII.GetBytes(compositeKey))) { oauth_signature = Convert.ToBase64String( hasher.ComputeHash(ASCIIEncoding.ASCII.GetBytes(base_string))); } string header_format = "OAuth oauth_nonce=\"{0}\", oauth_callback=\"{1}\", oauth_signature_method=\"{2}\", oauth_timestamp=\"{3}\", oauth_consumer_key=\"{4}\", oauth_signature=\"{5}\", oauth_version=\"{6}\""; string header = string.Format(header_format, Uri.EscapeDataString(oauth_nonce), Uri.EscapeDataString(oauth_callback), Uri.EscapeDataString(oauth_signature_method), Uri.EscapeDataString(oauth_timestamp), Uri.EscapeDataString(oauth_consumer_key), Uri.EscapeDataString(oauth_signature), Uri.EscapeDataString(oauth_version)); ServicePointManager.Expect100Continue …

Member Avatar
Member Avatar
+0 forum 4

As many of you know, DaniWeb now has an API. It (optionally) uses OAuth 2.0 and it supports both server-side and client-side implementations. The server-side method I have down pat. However, I had to hack together the clientside implementation, and although it works, I'm not sure it's done "correctly". I wasn't able to find any tutorials on the web about how you're supposed to do it. From what I could tell, every API simply included their own proprietary Javascript-based SDK. Can any JS experts out there please take a look at my implementation and let me know how to streamline …

Member Avatar
Member Avatar
+0 forum 4

First off, I'm not sure if this the appropriate place to post this question, but I thought I would just try anyway :?: I was wondering if anyone had any fun APIs that I could use basic authentication more specifically cURL. I you used to be able to use basic authentication with Twitter, but they changed it to use oauth. Due to irrelevance for my project, I don't want to waste more time wrapping my head around oath. I would rather just try to find a different "test" to work with. When I mean "fun", I mean anything that's other …

Member Avatar
Member Avatar
+0 forum 1

Hi Guy's, I need to write a simple application that posts to twitter using (most probably) the Zend framework. This application should work for only 1 user. I have tried numerous different tutorials, but keep getting stuck. Please help :-(

Member Avatar
Member Avatar
+0 forum 1

Does anybody know a good working Python 3.x wrapper for OAUTH2? I'm having issues with the backwards incompatability with simplegeo-python-oauth2.:'(

Member Avatar
Member Avatar
+0 forum 1

Hi everyone, I have a project that need an API but still in progress. But, I have a problem with this API authentication. The authentication method I want to use is oAuth. But, unfortunately I don't have any acknowledgement about authentication. I've read many tutorial but I still don't know how to start because most of them explain about the client side authentication. And what I need right now is complete example about oAuth implementation (server and client side) and how to deal with the database as well. So, the main question is : [B]Does someone has any resources about …

Member Avatar
Member Avatar
+0 forum 7

The End.