Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (28 sloc) 1.13 KB
import oauth.signpost.*
import oauth.signpost.basic.*
import oauth.signpost.http.*
import oauth.signpost.signature.*
import oauth.signpost.exception.*
import zero.core.utils.URIUtils
//Consumer key & secret from are stored in zero.config
OAuthConsumer consumer = new DefaultOAuthConsumer(
OAuthProvider provider = new DefaultOAuthProvider(
println "<pre>"
println "Fetching consumer request tokens..."
def callbackUri = URIUtils.getAbsoluteUri('/verify.groovy')
def authUrl = provider.retrieveRequestToken(consumer, callbackUri)
zput("/user/consumer", consumer)
zput("/user/provider", provider)
zput("/user/authurl", authUrl)
println "Consumer object: " + consumer
println "Consumer token secret: " + consumer.tokenSecret
println "Consumer token: " + consumer.token
println ""
println "Go here and authorise the app for your account: "
println "<a href='${authUrl}'>${authUrl}</a>"
println '</pre>'