Skip to content

Instantly share code, notes, and snippets.

@Zoramite
Created July 16, 2011 00:44
Show Gist options
  • Save Zoramite/1085852 to your computer and use it in GitHub Desktop.
Save Zoramite/1085852 to your computer and use it in GitHub Desktop.
Railo Method Not Defined When Using Shared Scopes Test
<cfif not structKeyExists(application, 'openIDConsumer') or structKeyExists(url, 'reinit')>
<cfset application.openIDConsumer = createObject('java', 'org.openid4java.consumer.ConsumerManager', expandPath('./openid4java.jar')).init() />
</cfif>
<cfset openIDConsumer = application.openIDConsumer />
<cfset discoveries = openIDConsumer.discover('https://www.google.com/accounts/o8/id') />
<cfset discovered = openIDConsumer.associate(discoveries) />
<cfset authReq = openIDConsumer.authenticate(discovered, 'http://getRailo.org') />
<!--- Add fetch requests --->
<cfset fetch = createObject('java', 'org.openid4java.message.ax.FetchRequest', expandPath('./openid4java.jar')).createFetchRequest() />
<cfset fetch.addAttribute("FirstName", "http://axschema.org/namePerson/first", true) />
<cfset fetch.addAttribute("LastName", "http://axschema.org/namePerson/last", true) />
<cfset fetch.addAttribute("Email", "http://axschema.org/contact/email", true) />
<cfset fetch.addAttribute("Language", "http://axschema.org/pref/language", true) />
<cfset authReq.addExtension(fetch) />
<cfoutput>#authReq.getDestinationUrl(true)#</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment