Child pages
  • JSAuthenticateRequest

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rev: 1377846354666
Wiki Markup
{div:style=display:none}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.\\		\\		Enter additional information related to this 'class' inside the \{div} macro with 'id=description'{div}
{div:id=description}{div}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}void{td}{td}[#addAttributeRequest]\(alias, schemaURI, required)
Add attribute request{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#execute]\(){td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=addAttributeRequest-String_String_Boolean}{tr:id=name}{td}h6.addAttributeRequest{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}addAttributeRequest{span}{span}\(alias, schemaURI, required){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} alias
\{[String]} schemaURI
\{[Boolean]} required
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
authenticateRequest.addAttributeRequest('email','http://axschema.org/contact/email',true);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=execute}{tr:id=name}{td}h6.execute{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}execute{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var authenticateRequest = plugins.openid.createAuthenticateRequest('https://www.google.com/accounts/o8/id',openIDLoginCallback);
authenticateRequest.addAttributeRequest('email','http://axschema.org/contact/email',true);
//see http://www.axschema.org/types/ for more attributes, not all are supported by all providers!
authenticateRequest.execute();

//sample
//function openIDLoginCallback(identifier,authenticateResult)
//{
//	var ok = false;
//	if (identifier)
//	{
//		var id = identifier.substring(identifier.lastIndexOf('=')+1)
//		application.output('id:'+id)
//		var email = authenticateResult.getAttributeValue('email')
//		application.output('email:'+email)
//		ok = security.login(email, id, ['Administrators'])
//	}
//	if (!ok)
//	{
//		application.output('Login failed')
//	}
//}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}