OAuth 2.0 in emacs – Part 4

Finally managed to authenticate against WordPress.com using the oauth2 library.
Here is my sample code which returns an access token.

(let ((code (oauth2-request-authorization "https://public-api.wordpress.com/oauth2/authorize?blog=jasonblewis.wordpress.com" "2194" "" "" "http://emacstragic.net")
 ))
  (oauth2-request-access "https://public-api.wordpress.com/oauth2/token" "2194" "" code "http://emacstragic.net" )
  )

WordPress at least seems to be fussy about what you use as the Redirect URI. It needs to match the uri you set in the app settings of the wordpress developer page or you denied access.

Leave a comment

Your email address will not be published. Required fields are marked *