north
1.0.0oAuth 1.0a server and client implementation, the successor to South.
About North
North is a library that implements the OAuth 1.0a consumer and provider protocols. It allows you to connect to an OAuth provider and request its resources, or to build your own OAuth provider.
How To: Client
If you want to connect to an OAuth provider, simply instantiate a client
and pass it the required parameters. Following the Twitter requirements and using the tokens from Chirp, we end up with this:
(defvar *client*
(make-instance
'north:client
:key "D1pMCK17gI10bQ6orBPS0w"
:secret "BfkvKNRRMoBPkEtDYAAOPW4s2G9U8Z7u3KAf0dBUA"
:request-token-uri "https://api.twitter.com/oauth/request_token"
:authorize-uri "https://api.twitter.com/oauth/authorize"
:access-token-uri "https://api.twitter.com/oauth/access_token"))
Next we start the authentication process:
(north:initiate-authentication *client*)
Visit the returned URL and enter the verification code:
(north:complete-authentication *client* ".....")
And finally we can access some resources:
(ql:quickload :cl-json)
(defmacro with-json-decoding (() &body body)
`(let ((drakma:*text-content-types* (list* '("application" . "json") drakma:*text-content-types*)))
(cl-json:decode-json-from-string
(progn ,@body))))
(with-json-decoding ()
(north:make-signed-request *client* "https://api.twitter.com/1.1/account/verify_credentials.json" :get
:params '(("include_entities" . "true"))))
(with-json-decoding ()
(north:make-signed-request *client* "https://api.twitter.com/1.1/statuses/update.json" :post
:params '(("status" . "North and South, no matter where I look there's parens."))))
We can also post some data:
(with-json-decoding ()
(north:make-signed-data-request *client* "https://api.twitter.com/1.1/statuses/update_with_media.json"
`(("media[]" . #p"~/sweet-bear.jpg"))
:params '(("status" . "Check out this sweet bear!"))))
In order to keep the access token and secret so you can resume your session without repeatedly logging in every time, you can serialise the client with make-load-form
.
How To: Server
In order to provide a server you need to have a way of persisting two main pieces of information: applications, and sessions. The minimal amount of information necessary for an application is its key and secret. You most likely want to add additional information such as a name, icon, and description so that they can be displayed to the user when they authorise a consumer. A session needs to store quite a few pieces more: a token, token-secret, verifier token, callback, the application key, and the access rights. Default classes to contain all this information are provided through application
and session
.
However, the persistence and bookkeeping of these objects is still up to your server implementations. To do this, you should subclass server
and implement methods for make-application
, make-session
, application
, session
, rehash-session
, revoke-application
, revoke-session
, record-nonce
, and find-nonce
. What exactly these functions should accomplish is described in their docstrings and should be fairly obvious.
Once that is done, what's left to do is create a webservice with at least three endpoints. One for the request token, one for the authorization page, and one for the access token.
General Behaviour for All Endpoints
For each endpoint there exists a corresponding function to call, which will return a number of values that should be returned to the user. You can use alist->oauth-response
to construct a properly formatted response body. The objects that you need to pass to these calls are your server
instance and a request
instance that encapsulates the data that the server received with the request.
Each endpoint function performs certain checks against the request and in case of problems signals an error. Your server should intercept these and act as follows: if the error is a parameter-error
, the HTTP response code should be 400
, and if the error is a verification-error
, it should be 401
. Any other error is up to you. You may display information about the error in the response body, but the exact formatting thereof is up to you as well. It is however a good idea to output the same data format as your other endpoints would, aside from the oauth specific ones.
The Request Token Endpoint
The request token endpoint should call oauth/request-token
and return the values as oauth_token
, oauth_token_secret
, and oauth_callback_confirmed
respectively.
The Authorize Endpoint
The authorize page is special in the sense that it is not called with an oauth signed request. Instead the user calls it through a browser and the only thing it receives is the request token. The provider must then first authenticate the user and after having done so, display a page to the user that shows information about the application that they're connecting through and give them the option to either allow the application access or deny it.
If the user selects allow, oauth/authorize
should be called. If it returns a third value, the server should cause the user to be redirected to that URL. If not, the server should display a page that shows the second value, which is the verification token. The user must then copy this value into the consumer.
If the user selects deny, the provider must not necessarily do anything except ensure that the session
is revoked and thus prevent the consumer from gaining access. It is not required to notify the consumer of this in any way.
The Access Token Endpoint
The access token endpoint should call oauth/access-token
and return the values as oauth_token
, and oauth_token_secret
respectively.
Protected Resource Endpoint
Any such endpoint should call oauth/verify
. This function returns nothing useful and only performs checks that if failed result in an error being signalled as usual. You may additionally want to check the session for permissions to access the specific endpoint if such a distinction exists. However, such additional functionality is up to you to design.
An Example Server / Client Setup
See the north-example system for a primitive, simple setup of a provider and consumer.
OAuth Overview
OAuth is supposed to provide a relatively convenient standardised way to authenticate a user against a service (provider), and then allow the application (consumer) to access resources on the user's behalf. Key to this are two parts, the signing process, and the actual authorisation process itself.
The Authorisation Process
Before an OAuth consumer can access any resources, it needs to obtain an access token. The path to this token happens in three distinct steps, during which several pieces of information need to be remembered and modified on both the consumer and provider's sides.
Step 0: Generating an Application
Unfortunately this is already where things begin to become awkward with the OAuth specification. The spec conflates what is essentially an application with the consumer. In order to improve clarity, North makes a distinction here. An application is a server-side instance that identifies a range of consumers. A consumer is a specific instance of a program that would like to connect to a provider through an application.
Whatever the case may be, before you can connect at all, you need to have access to an application key and secret. These two pieces are vital in the signing and requesting process. In North, this can be done through make-application
. Once you have an application, you can get its key
and secret
.
Step 1: Requesting a Request Token
Now we actually start exchanging things with the provider as a consumer. To do this we send a signed request to the server's request-token endpoint. The request is signed using our application's secret, and we pass along the application's key as an OAuth parameter. Additionally we must give the provider a callback parameter that tells it what to do in the next step.
The provider then verifies our signature, and if it thinks everything is proper, then it sends back a body containing a request token and request secret. From here on out our requests will need to contain the token as an OAuth parameter and be signed with the request secret along with the application secret.
Step 2: The User Authorises the Consumer
The next step has to be done by the user themselves, such that granting access is always done through explicit consent. To do this, the consumer constructs an URL to the provider's authorize endpoint with the request token added as a GET parameter. The user then has to visit this URL.
Once on the page, the user should be confronted with a confirmation dialog, potentially also displaying all the things the consumer could get access to, if authorised. If the user accepts, the server generates a verifier token, which is then passed back to the consumer. This happens either automatically through a redirect, if the callback was a valid URL, or through the user manually, if the callback was the string "oob". In the latter case, the verifier is displayed to the user on the website, and they have to copy it into the consumer.
Step 3: Requesting an Access Token
The final step is to exchange the request token with an access token, using the verifier that was obtained in the previous section. To do this, a fully signed request is made to the provider's access-token endpoint, which verifies the request and verifier, rehashes the consumer's token, and upgrades its access. It then returns the newly generated access token and secret that will henceforth be used to sign requests.
Step 4: Accessing Resources
Now that we have an access token, we can start requesting whatever resources we were permitted to. A provider may for example offer several kinds of access tokens with varying ranges of permissions. The request endpoints are of course the provider's own decision. The only thing that OAuth specifies henceforth is that the request must be fully signed.
Error Handling
Now, you may notice in all this that there's no specification on how to handle errors. And you're right. The only thing OAuth says is that missing/duplicate parameters must result in an HTTP return code of 400, and an invalid signature must result in a return code of 401. Everything else, what specifically went wrong, how to fix it, or any other thing that might be useful is unspecified. Some providers do give some error information, but the format in which the error is presented is up to them.
As such, North makes no assumptions whatsoever about how to parse the body contents on an error. You will, unfortunately, have to deal with that on your own. To do this, handle the request-failed
error and parse the body
of it.
The Signing Process
Now comes the hard part. The actual signing process is unbelievably convoluted and incredibly easy to mess up. Let's start simple.
The Authorization Header
A signed request must contain an "Authorization" header, which must begin with the string "OAuth ". Following it are a series of oauth parameters. Each key/value pair is separated by a comma and a space, each key is separated from the value by an equals sign, and each value is surrounded by double-quotes. Each key and value must also be url-encoded. Keep in mind here that in order to transmit the request, this header is again url-encoded.
The OAuth Parameters
For each request a certain set of OAuth parameters must be present. Every request must have the oauth_consumer_key
, oauth_signature_method
, oauth_signature
, oauth_timestamp
, and oauth_nonce
. Additional parameters are oauth_callback
, oauth_token
, and oauth_verifier
, and whatever else the provider may want to require. These parameters must be ordered lexicographically by their keys and in case of duplicate keys by their values.
The oauth_consumer_key
is the application key that we obtained in step 0. The oauth_timestamp
must be an integer representing the unix-time when the request was formed. The oauth_nonce
must be a unique string for each timestamp, but must not necessarily be globally unique.
The OAuth Signature
The final piece is the signature itself. The signature is created using a signing method (oauth_signature_method
) over a signature base string, using a signature key.
The signature key is simply the application secret, appended with an &, appended with the token secret, if we have one.
The signature base string is constructed by the uppercase representation of the request method (POST/GET) followed by an &, followed by the url-encoded, normalised url, followed by an &, followed by the url-encoded, concatenated parameters.
Normalising the URL
The URL must be normalised such that the schema is in all lowercase and the port is omitted if it is 80 and the schema is http, or if it is 443 and the schema is https.
Concatenating the Parameters
The parameters here are all of the parameters. Namely the oauth parameters (except the signature itself), the get parameters, and the post parameters. The parameters must again be sorted as before, but now they are concatenated differently. Namely each pair is separated by an ampersand, the key is separated from the value by an equals sign, and both keys and values must be url-encoded. Note that unlike before, values must not be surrounded by double-quotes.
Signing the Token
Potentially any signature method you might want is supported. The provider can request whatever they want. North implements the plaintext, hmac-sha1, and cmac-aes methods suggested by the spec. See the relevant hashing methods for information on how they work.
A Reminder, Just For Fun
The request is sent, url-encoded. The authorization header has url-encoded parameter values. One of those is the signature, which was constructed from a base string that has an url-encoded url part, and an url-encoded parameter part. The parameter part has url-encoded parameter values. Url-encode!
System Information
Definition Index
-
NORTH
- ORG.SHIRAKUMO.NORTH
No documentation provided.-
EXTERNAL SPECIAL-VARIABLE *EXTERNAL-FORMAT*
The external format to use to url-en/decode and execute requests. Defaults to :UTF-8
-
EXTERNAL CLASS APPLICATION
-
EXTERNAL CLASS CLIENT
An oAuth client class to encapsulate a single connection to a provider. Contains all the necessary information and state to manage the connection. You may serialise this object into a reloadable form using MAKE-LOAD-FORM. Unless the provider expires access tokens or the token is revoked for some reason or another, the authentication process for a client has to be done only once. See KEY See SECRET See TOKEN See TOKEN-SECRET See CALLBACK See REQUEST-TOKEN-URI See AUTHORIZE-URI See ACCESS-TOKEN-URI See VERIFY-URI See INITIATE-AUTHENTICATION See COMPLETE-AUTHENTICATION
-
EXTERNAL CLASS REQUEST
Container class to represent an HTTP request. Upon initialisation a few default oauth parameters are set, if not given already: oauth_nonce Set to (make-nonce) oauth_signature_method Set to "HMAC-SHA1" oauth_timestamp Set to (make-timestamp) oauth_version Set to "1.0" Additionally, if the headers given include an Authorization header, then the oauth parameters are overridden by the results of DESTRUCTURE-OAUTH-HEADER. See HTTP-METHOD See URL See PARAMETERS See HEADERS See OAUTH See DESTRUCTURE-OAUTH-HEADER
-
EXTERNAL CLASS SERVER
Mixin representing a server class.
-
EXTERNAL CLASS SESSION
-
EXTERNAL CLASS SIMPLE-SERVER
A very primitive and simple sample server implementation that stores everything in mere hash tables. Do not use this server for your production provider. You should implement one yourself the provides proper persistence and expiration of the providers, sessions, and nonces. See SERVER See APPLICATIONS See SESSIONS See NONCES
-
EXTERNAL CONDITION BAD-VERSION
An error signalled when the oAuth request specifies a bad version field. See PARAMETER-ERROR
-
EXTERNAL CONDITION CALLBACK-UNCONFIRMED
An error signalled when the provider returns a non-"true" value for the oauth_callback_confirmed key. See CLIENT-ERROR
-
EXTERNAL CONDITION CLIENT-ERROR
An error signalled when the oAuth client encounters a problem. See NORTH-CONDITION
-
EXTERNAL CONDITION INVALID-APPLICATION
An error signalled when the oauth_consumer_key of the request is invalid or unknown. See VERIFICATION-ERROR
-
EXTERNAL CONDITION INVALID-SIGNATURE
An error signalled when the oAuth signature cannot be verified. This is most likely due to a bad signing procedure on the client's behalf, or a disagreement about the tokens and secrets used in the signing process. See VERIFICATION-ERROR
-
EXTERNAL CONDITION INVALID-TOKEN
An error signalled when the token of the request is invalid or unknown. See VERIFICATION-ERROR
-
EXTERNAL CONDITION INVALID-VERIFIER
An error signalled when the verifier of the request is invalid for the associated request token. See VERIFICATION-ERROR
-
EXTERNAL CONDITION NONCE-REUSED
An error signalled when a nonce is used twice within the same timestamp. See VERIFICATION-ERROR
-
EXTERNAL CONDITION NORTH-CONDITION
Base condition class for conditions in the North system. See REQUEST
-
EXTERNAL CONDITION PARAMETER-ERROR
An error signalled when the parameters given to the provider are incomplete or badly specified. Should end up in an HTTP 400 return code. See NORTH-CONDITION
-
EXTERNAL CONDITION PARAMETERS-MISSING
An error signalled when the oAuth request does not include all the required oAuth parameters. See PARAMETERS See PARAMETER-ERROR
-
EXTERNAL CONDITION REQUEST-FAILED
An error signalled when a client's request returned with a non-200 status code. See BODY See STATUS-CODE See HEADERS See CLIENT-ERROR
-
EXTERNAL CONDITION VERIFICATION-ERROR
An error signalled when the parameters given to the provider fail the verification test. Should end up in an HTTP 401 return code. See NORTH-CONDITION
-
EXTERNAL CONDITION VERIFIER-TAKEN
An error signalled when a verifier token for a request is re-used or the authorization step is repeated for the same request token. See VERIFICATION-ERROR
-
EXTERNAL FUNCTION ALIST->OAUTH-RESPONSE
- ALIST
Concatenates an alist into an oauth response body. See CONCAT-PARAMS.
-
EXTERNAL FUNCTION CONCAT-PARAMS
- PARAMS
- &KEY
- QUOTE
- (DELIM &)
Concatenate the given alist into a single parameter string. This intermits an equal sign between key and value, and DELIM between each pair. If QUOTE is non-NIL, the values are surrounded by #\".
-
EXTERNAL FUNCTION CREATE-SIGNATURE
- CONSUMER-SECRET
- TOKEN-SECRET
- METHOD
- URL
- OAUTH-PARAMS
- &OPTIONAL
- PARAMS
Create an oAuth signature for the given parameters. This does not include the oauth_signature parameters if it is passed in OAUTH-PARAMS. Calls SIGN using the oauth_signature_method oauth param, a normalized token from the OAUTH-PARAMS and GET-PARAMS, and the given CONSUMER-SECRET and TOKEN-SECRET. See SIGN See NORMALIZE-TOKEN
-
EXTERNAL FUNCTION DESTRUCTURE-OAUTH-HEADER
- HEADER
Destructures an Authorization header into its oauth parameters. Returns an alist of all the parameters with their associated values. If the header is malformed, an error is signalled.
-
EXTERNAL FUNCTION MAKE-NONCE
Creates a default nonce by turning a V4 UUID into a string.
-
EXTERNAL FUNCTION MAKE-REQUEST
- URL
- METHOD
- &KEY
- PARAMS
- HEADERS
- OAUTH
Shorthand function to construct a request object.
-
EXTERNAL FUNCTION MAKE-TIMESTAMP
Creates a default timestamp by turning a unix timestamp into a string.
-
EXTERNAL FUNCTION NORMALIZE-URL
- URL
Normalises the URL to avoid ambiguity. In specific, it downcases the scheme, removes leading slashes from the path, and omits the 80 port if the scheme is HTTP, and the 443 port if the scheme is HTTPS.
-
EXTERNAL FUNCTION OAUTH-RESPONSE->ALIST
- BODY
Splits the body into an alist of keys and values.
-
EXTERNAL FUNCTION PGET
- KEY
- ALIST
Easy accessor for alists. Checks keys STRING-EQUALly and returns the value directly, if found. SETF-able. If a key is set that does not occur in the alist, a new entry is PUSHed, otherwise the existing one is modified. The key is coerced using ALIST-KEY See ALIST-KEY
-
EXTERNAL FUNCTION SORT-PARAMS
- PARAMS
Creates a fresh list in which the parameters are sorted. See PARAM<
-
EXTERNAL FUNCTION URL-DECODE
- STRING
- &OPTIONAL
- (EXTERNAL-FORMAT *EXTERNAL-FORMAT*)
Decode the string into plain text format. See *EXTERNAL-FORMAT*
-
EXTERNAL FUNCTION URL-ENCODE
- THING
- &OPTIONAL
- (EXTERNAL-FORMAT *EXTERNAL-FORMAT*)
Encode the string into url-encoded format as required by the oAuth spec. Namely all characters except [0-9], [a-z], [A-Z], and [-._~] are encoded. See *EXTERNAL-FORMAT*
-
EXTERNAL GENERIC-FUNCTION ACCESS
- OBJECT
Accessor to what kind of access the session has. Should initially be :request, and is set to :access once the handshake has completed. See SESSION
-
EXTERNAL GENERIC-FUNCTION (SETF ACCESS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION ACCESS-TOKEN-URI
- OBJECT
Accesses the oauth/access-token uri, the third endpoint for the oAuth process.
-
EXTERNAL GENERIC-FUNCTION (SETF ACCESS-TOKEN-URI)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION APPLICATION
- SERVER
- APPLICATION-KEY
Returns the application object associated with the given key on the server, if any. See SERVER See APPLICATION
-
EXTERNAL GENERIC-FUNCTION APPLICATIONS
- OBJECT
Accessor to the hash table of key -> application in the server. See SIMPLE-SERVER
-
EXTERNAL GENERIC-FUNCTION (SETF APPLICATIONS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION AUTHORIZE-URI
- OBJECT
Accesses the oauth/authorize uri, the second endpoint for the oAuth process.
-
EXTERNAL GENERIC-FUNCTION (SETF AUTHORIZE-URI)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION BODY
- CONDITION
The returned http body of the failed request. This may be an octet-vector if the content type is not known to drakma. See REQUEST-FAILED See DRAKMA:*TEXT-CONTENT-TYPES*
-
EXTERNAL GENERIC-FUNCTION CALL
- REQUEST
- &REST
- ARGS
Executes the given request object. If the http status code returned is 200, the response body is returned. Otherwise, an error of type REQUEST-FAILED is signalled. Note that the allowed extra arguments are dependant on the backend being used. The one parameter that must be universally recognised is the :FORM-DATA boolean, designating whether the parameters contain form data to be sent over the request such as files. Files in the parameter list should be either a cons of the parameter name and file as pathname or octet-vector, or a list of name, file, and optional keyword arguments. The only file keyword argument currently recognised is :CONTENT-TYPE, specifying the supplied content-type that should be submitted to the server for the file. See REQUEST See REQUEST-FAILED
-
EXTERNAL GENERIC-FUNCTION CALL-SIGNED
- REQUEST
- CONSUMER-SECRET
- &OPTIONAL
- TOKEN-SECRET
- &REST
- ARGS
Execute the given request object after signing it. See REQUEST See CALL See MAKE-AUTHORIZED See MAKE-SIGNED
-
EXTERNAL GENERIC-FUNCTION CALLBACK
- OBJECT
Accesses the callback to which the oauth/authorize step should redirect. If it should not redirect, the callback must be exactly the string "oob".
-
EXTERNAL GENERIC-FUNCTION (SETF CALLBACK)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION COMPLETE-AUTHENTICATION
- CLIENT
- VERIFIER
- &OPTIONAL
- TOKEN
Complete the authentication process for the client. This performs an oauth/access-token request. This operation modifies the TOKEN and TOKEN-SECRET fields of the client. When the client has a VERIFY-URI given, an additional oauth/verify request is made to test whether the full process was complete. See CLIENT See MAKE-SIGNED-REQUEST
-
EXTERNAL GENERIC-FUNCTION FIND-NONCE
- SERVER
- TIMESTAMP
- NONCE
If the given nonce was used before on the given timestamp, return non-NIL.
-
EXTERNAL GENERIC-FUNCTION HEADERS
- CONDITION
Accesses the HTTP headers of the request.
-
EXTERNAL GENERIC-FUNCTION (SETF HEADERS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION HTTP-METHOD
- OBJECT
Accesses the HTTP-METHOD (GET/POST) of the request.
-
EXTERNAL GENERIC-FUNCTION (SETF HTTP-METHOD)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION INITIATE-AUTHENTICATION
- CLIENT
Start the authentication process for the client. This performs an oauth/request-token request and constructs the proper oauth/authorize URL for the user to visit. This address is returned. If the provider did not confirm the callback, an error of type CALLBACK-UNCONFIRMED is signalled. This operation modifies the TOKEN and TOKEN-SECRET fields of the client. See CLIENT See MAKE-SIGNED-REQUEST
-
EXTERNAL GENERIC-FUNCTION KEY
- OBJECT
Accesses the application key.
-
EXTERNAL GENERIC-FUNCTION (SETF KEY)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION MAKE-APPLICATION
- SERVER
- &KEY
- NAME
- &ALLOW-OTHER-KEYS
Creates and adds a new application object to the server. Additionally supported keyword arguments are used as initargs for the application instance. Which application class is used depends on the server. See SERVER See APPLICATION
-
EXTERNAL GENERIC-FUNCTION MAKE-AUTHORIZED
- REQUEST
Modifies the request to add the authorization header using the oauth parameters. If the oauth_signature parameter is missing, an error is signalled. Returns the request. See REQUEST
-
EXTERNAL GENERIC-FUNCTION MAKE-SESSION
- SERVER
- APPLICATION
- CALLBACK
- &KEY
- ACCESS
- &ALLOW-OTHER-KEYS
-
EXTERNAL GENERIC-FUNCTION MAKE-SIGNED
- REQUEST
- CONSUMER-SECRET
- &OPTIONAL
- TOKEN-SECRET
Modifies the request to add a signature to the oauth parameters. This will also modify the oauth parameters list to remove duplicates or empty values. Returns the request. See REQUEST See CREATE-SIGNATURE
-
EXTERNAL GENERIC-FUNCTION MAKE-SIGNED-DATA-REQUEST
- CLIENT
- URL
- DATA
- &KEY
- PARAMS
- HEADERS
- OAUTH
Construct and execute a signed request to send data payloads. Each data value can be either a pathname or an octet-vector. Returns the result of the request execution as the first value and the constructed request object itself as the second. See CLIENT See REQUEST See CALL-SIGNED
-
EXTERNAL GENERIC-FUNCTION MAKE-SIGNED-REQUEST
- CLIENT
- URL
- METHOD
- &KEY
- PARAMS
- HEADERS
- OAUTH
Construct and execute a signed request for the given client. Returns the result of the request execution as the first value and the constructed request object itself as the second. See CLIENT See REQUEST See CALL-SIGNED
-
EXTERNAL GENERIC-FUNCTION NAME
- OBJECT
Accessor to the name of the application. See APPLICATION
-
EXTERNAL GENERIC-FUNCTION (SETF NAME)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION NONCES
- OBJECT
Accessor to the hash table of timestamp -> nonce-list in the server. See SIMPLE-SERVER
-
EXTERNAL GENERIC-FUNCTION (SETF NONCES)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION OAUTH
- OBJECT
Accesses the pure oauth parameters of the request.
-
EXTERNAL GENERIC-FUNCTION (SETF OAUTH)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION OAUTH/ACCESS-TOKEN
- SERVER
- REQUEST
Perform the oauth/access-token step of the process. This verifies the request and if successful, upgrades its access to full. It will also invalidate the session's verifier and rehash it. Returns two values: TOKEN --- The newly generated access token. TOKEN-SECRET --- The newly generated access token secret. Signals a PARAMETER-ERROR or VERIFICATION-ERROR on an invalid request. See SERVER See VERIFIER See REHASH-SESSION See TOKEN See TOKEN-SECRET
-
EXTERNAL GENERIC-FUNCTION OAUTH/AUTHORIZE
- SERVER
- REQUEST
Perform the oauth/authorize step of the process. This verifies the request and returns three values: TOKEN --- The current request token. VERIFIER --- The (possibly newly generated) verifier for the next step. URL --- The callback URL to redirect to if the callback is not "oob". If the callback is indeed "oob", NIL is returned for this. Signals a VERIFICATION-ERROR on an invalid request. See SERVER See TOKEN See VERIFIER See CALLBACK
-
EXTERNAL GENERIC-FUNCTION OAUTH/REQUEST-TOKEN
- SERVER
- REQUEST
Perform the oauth/request-token step of the process. This creates a new session object and returns three values: TOKEN --- The newly generated request token. TOKEN-SECRET --- The newly generated request token secret. CALLBACK-CONFIRMED --- Whether the callback has been confirmed. According to the spec, this should always be T. Signals a PARAMETER-ERROR or VERIFICATION-ERROR on an invalid request. See SERVER See MAKE-SESSION See TOKEN See TOKEN-SECRET
-
EXTERNAL GENERIC-FUNCTION OAUTH/VERIFY
- SERVER
- REQUEST
Standard endpoint to use on any protected resource. This verifies the request and makes sure it uses a valid access token. Returns T on success. Signals a PARAMETER-ERROR or VERIFICATION-ERROR on an invalid request.
-
EXTERNAL GENERIC-FUNCTION PARAMETERS
- CONDITION
Accesses the parameters of the request.
-
EXTERNAL GENERIC-FUNCTION (SETF PARAMETERS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION RECORD-NONCE
- SERVER
- TIMESTAMP
- NONCE
Remember the given nonce for the used timestamp.
-
EXTERNAL GENERIC-FUNCTION REHASH-SESSION
- SERVER
- SESSION
-
EXTERNAL GENERIC-FUNCTION REQUEST
- CONDITION
The request object that the error occurred on. See NORTH-CONDITION
-
EXTERNAL GENERIC-FUNCTION REQUEST-TOKEN-URI
- OBJECT
Accesses the oauth/request-token uri, the first endpoint for the oAuth process.
-
EXTERNAL GENERIC-FUNCTION (SETF REQUEST-TOKEN-URI)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION REVOKE-APPLICATION
- SERVER
- APPLICATION-KEY
Removes the given application from the server. The application must be no longer reachable through CONSUMER on the server and all sessions authorized through this application must be invalidated. See SERVER See APPLICATION See SESSION
-
EXTERNAL GENERIC-FUNCTION REVOKE-SESSION
- SERVER
- TOKEN
-
EXTERNAL GENERIC-FUNCTION SECRET
- OBJECT
Accesses the application secret.
-
EXTERNAL GENERIC-FUNCTION (SETF SECRET)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION SESSION
- SERVER
- TOKEN
-
EXTERNAL GENERIC-FUNCTION SESSIONS
- OBJECT
Accessor to the hash table of token -> session in the server. See SIMPLE-SERVER
-
EXTERNAL GENERIC-FUNCTION (SETF SESSIONS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION SIGN
- METHOD
- DATA
- CONSUMER-SECRET
- &OPTIONAL
- TOKEN-SECRET
Signs the given data using the specified method. By default, :PLAINTEXT, :HMAC-SHA1, and :CMAC-AES are supported. A string can be used for the method as well, but will be converted to a keyword first.
-
EXTERNAL GENERIC-FUNCTION STATUS-CODE
- CONDITION
The returned status code of the failed request. See REQUEST-FAILED
-
EXTERNAL GENERIC-FUNCTION TOKEN
- OBJECT
Accesses the current (access or request) token.
-
EXTERNAL GENERIC-FUNCTION (SETF TOKEN)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION TOKEN-SECRET
- OBJECT
Accesses the current (access or request) token secret.
-
EXTERNAL GENERIC-FUNCTION (SETF TOKEN-SECRET)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION URL
- OBJECT
Accesses the URL of the request.
-
EXTERNAL GENERIC-FUNCTION (SETF URL)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION VERIFIER
- OBJECT
Accessor to the verifier token that the consumer has to provide to exchange the request token for an access token. See SESSION
-
EXTERNAL GENERIC-FUNCTION (SETF VERIFIER)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION VERIFY
- REQUEST
- CONSUMER-SECRET
- &OPTIONAL
- TOKEN-SECRET
Verifies whether the signature in the request is valid. To do this it destructures the Authorization header and uses it values to construct a new signature. This is then compared against the oauth_signature value in the oauth alist. See REQUEST See DESTRUCTURE-OAUTH-HEADER See CREATE-SIGNATURE
-
EXTERNAL GENERIC-FUNCTION VERIFY-URI
- OBJECT
Accesses the oauth/verify uri, an optional endpoint to test whether the process completed successfully.
-
EXTERNAL GENERIC-FUNCTION (SETF VERIFY-URI)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL SETF-EXPANDER PGET
- KEY
- ALIST
No documentation provided.