Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the south Reference Manual, version 0.3.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 05:53:57 2022 GMT+0.
Next: Systems, Previous: The south Reference Manual, Up: The south Reference Manual [Contents][Index]
This library has been superseded by North. Please use that instead, as its code based is an improvement from South in almost every respect and it includes the ability to provide the server side of the oAuth system as well.
Load South through Quicklisp or ASDF:
(ql:quickload :south)
First you need to tell South about the service you want to interact with. For this you will need at least the following three URLs
oauth/request-token
, oauth/authorize
, oauth/access-token
as well as the api-key
and api-secret
of your oAuth application that you want to use to connect. To set up South you can either set the according special variables directly or use the prepare
function:
(south:prepare
:oauth/request-token "https://api.twitter.com/oauth/request_token"
:oauth/authenticate "https://api.twitter.com/oauth/authenticate"
:oauth/authorize "https://api.twitter.com/oauth/authorize"
:oauth/access-token "https://api.twitter.com/oauth/access_token"
:api-key key
:api-secret secret)
Twitter requires an additional authenticate
URL, which is otherwise set to the same as the authorize
address. To start the authentication process simply call initiate-authentication
. If your addresses and api codes are correct, it should return an URL that the user has to visit in their browser.
(south:initiate-authentication)
By default this will use the SERVER method, which loads and starts a hunchentoot instance on *SERVER-PORT*
. After the remote authentication has been accepted it redirects to this local server. If you want to handle the server yourself, you should instead pass a callback URL as the :method
to initiate-authentication
. Depending on the service it might provide additional non-standard authentication methods, like twitter's PIN. The PIN method is already integrated into South, but anything beyond that you will have to add yourself. If you choose to use your own server or a different method, you will need to call complete-authentication
with the verifier and optionally the access-token.
(south:complete-authentication verifier :token access-token)
The SERVER method will automatically call complete-authentication
once it receives the request and shuts itself down. If complete-authentication
returns successfully you should now be all set to perform oAuth requests. To request with oAuth signatures, you can use the signed-request
function.
(south:signed-request "https://api.twitter.com/1.1/account/verify_credentials.json")
Depending on how your service requires it, posting form data may require special treatment. South provides a signed-data-request
function that is geared towards how twitter requires it, but it may also work for other services.
If you need to handle multiple oAuth accounts at the same time you may want to use the with-oauth-environment
macro to establish dynamic bindings around the internal special variables. The macro accepts parameters for all the environment variables so you may directly set them without needing to call prepare
.
If your application uses South, please let me know so I can list it here!
Next: Files, Previous: Introduction, Up: The south Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Simple OaUTH library for oAuth1.0
Nicolas Hafner <shinmera@tymoon.eu>
Nicolas Hafner <shinmera@tymoon.eu>
(GIT https://github.com/Shinmera/south.git)
zlib
0.3.0
Next: Packages, Previous: Systems, Up: The south Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: south/toolkit.lisp, Previous: south/south.asd, Up: Lisp [Contents][Index]
Next: south/oauth.lisp, Previous: south/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
south (system).
Previous: south/toolkit.lisp, Up: Lisp [Contents][Index]
toolkit.lisp (file).
south (system).
Next: Definitions, Previous: Files, Up: The south Reference Manual [Contents][Index]
Packages are listed by definition order.
org.tymoonnext.south
common-lisp.
Next: Indexes, Previous: Packages, Up: The south Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Macros, Previous: Public Interface, Up: Public Interface [Contents][Index]
Function called when COMPLETE-AUTHENTICATION is called.
Two arguments are passed, the ACCESS-TOKEN and the ACCESS-SECRET.
The external format used for encoding/decoding.
Next: Ordinary functions, Previous: Special variables, Up: Public Interface [Contents][Index]
Establishes an environment for all oauth related special variables.
Unless a non-NIL value is provided for a parameter it is bound to the current value of the according special variable.
Next: Generic functions, Previous: Macros, Up: Public Interface [Contents][Index]
Finishes the authentication procedure by retrieving the access token. Sets the *OAUTH-TOKEN* and *OAUTH-TOKEN-SECRET* to their respective values.
Generate a NONCE to use for requests. Currently this simply uses a v4-UUID.
Starts the authentication process and returns an URL that the user has to visit.
METHOD can be one of :PIN :SERVER or a string designating a callback URL.
Note that the :PIN method is NOT STANDARD and thus might not be available for your service.
See OAUTH/AUTHORIZE, INITIATE-SERVER-AUTHENTICATION and OAUTH/AUTHENTICATE respectively.
Initiate the authentication through the server mechanism. This is the same as the redirect mechanism, except it starts up a Hunchentoot server automatically and handles the callback for you. The server will be started on *SERVER-PORT* and will be shut down automatically after a single request.
Turn the tokens received through the authentication into an access token.
According to spec https://dev.twitter.com/docs/auth/implementing-sign-twitter
Initiate the authentication through the redirect mechanism.
Returns an URL that the user has to open in the browser.
Upon successful authentication, the page should redirect back
to the specified callback url. This callback endpoint should then
pass the proper parameters to COMPLETE-AUTHENTICATION.
According to spec https://dev.twitter.com/docs/auth/implementing-sign-twitter
Initiate the authentication through the PIN mechanism.
Returns an URL that the user has to open in the browser.
This page should, upon successful authentication, return a PIN
that has to be initialized by passing it to COMPLETE-AUTHENTICATION.
According to spec https://dev.twitter.com/docs/auth/pin-based-authorization
Query for a request token using the specified callback.
Returns an ALIST containing :OAUTH-TOKEN, :OAUTH-TOKEN-SECRET and
:OAUTH-CALLBACK-CONFIRMED, the first two being strings and the last a boolean.
According to spec https://dev.twitter.com/docs/auth/implementing-sign-twitter
Query for a PIN based request token.
Seee CALLBACK-REQUEST-TOKEN.
According to spec https://dev.twitter.com/docs/auth/pin-based-authorization
Cosmetic function to set the oauth request URLs and api-key and -secret. This only sets the internal value of the parameter if it is non-NIL.
Resets the internal API-KEY, API-SECRET, ACCESS-TOKEN and ACCESS-SECRET to NIL. This does not change the oauth request URLs.
Issue a signed data request against the API.
See SIGNED-REQUEST. The difference to SIGNED-DATA-REQUEST is that
the default PARAMETERS are used to calculate the authorization header,
whereas the DATA-PARAMETERS are not. In SINGED-DATA-REQUEST, neither
of the parameters are used for the header.
Issue a signed data request against the API.
See SIGNED-REQUEST.
According to spec https://dev.twitter.com/docs/uploading-media
Issue a signed request against the API.
This requires the *oauth-api-key*, *oauth-signature-method*,
*oauth-version* and at least *oauth-api-secret* to be set.
See CREATE-SIGNATURE.
For return values see DRAKMA:HTTP-REQUEST
According to spec https://dev.twitter.com/docs/auth/authorizing-request
Issue a signed data request against the API.
See SIGNED-REQUEST. Returns values according to DRAKMA:HTTP-REQUEST with :WANT-STREAM T
Returns a URL-decoded version of the string STRING external format EXTERNAL-FORMAT.
According to spec https://dev.twitter.com/docs/auth/percent-encoding-parameters
Returns a URL-encoded version of the string STRING or OCTET-SEQUENCE using the external format EXTERNAL-FORMAT.
According to spec https://dev.twitter.com/docs/auth/percent-encoding-parameters
Next: Conditions, Previous: Ordinary functions, Up: Public Interface [Contents][Index]
Previous: Generic functions, Up: Public Interface [Contents][Index]
error.
:parameter
:status
:body
:headers
:url
:method
:parameters
:sent-headers
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Ordinary functions, Previous: Internals, Up: Internals [Contents][Index]
The universal to unix time difference in seconds.
Turns the OAuth parameters into the correct header value.
Create an OAuth signature for a request.
This requires at least the *oauth-api-secret* to be bound properly, and
usually the *oauth-access-secret* as well.
According to spec https://dev.twitter.com/docs/auth/creating-signature
Return the unix timestamp for GMT, as required by OAuth.
Returns a base-64 encoded string of the HMAC digest of the given STRING using the KEYSTRING as HMAC key. The encoding of *external-format* is used throughout.
Returns the signed version of the oauth-parameters.
Simply generates a signature and appends the proper parameter.
Turn an oauth-response into an ALIST.
Parses a string boolean. If the string is one of (T, true, 1), then T is returned, otherwise NIL. The check is case-insensitive.
Turns a key into a keyword.
Replaces _ with - and uppercases the string, then interns it
into the keyword package. This is useful to parse the request
responses into an alist.
Previous: Definitions, Up: The south Reference Manual [Contents][Index]
Jump to: | (
A C F G H I M O P R S T U W |
---|
Jump to: | (
A C F G H I M O P R S T U W |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | %
*
+
C S |
---|
Jump to: | %
*
+
C S |
---|
Jump to: | C F O P S T |
---|
Jump to: | C F O P S T |
---|