• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Remote login through a web service

LEGEND ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

Can you set up a login process in a CFC so it can be used remotely through a
web service? I would like to have my members be able to have their clients
login to a section of my web site through their own web site.

Is there anyplace I can find an example of this?

--
Wally Kolcz
Developer / Support


TOPICS
Advanced techniques

Views

192

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 13, 2006 Jul 13, 2006

Copy link to clipboard

Copied

LATEST
<cfcomponent>
<cffunction name="CLogin" access="remote" returntype="string">
<cfargument name="username" type="string" required="true">
<cfargument name="password" type="string" required="true"
<cfset
MM_redirectLoginSuccess=" http://www.softproofs.com/clientarea/index.cfm">
<cfset MM_redirectLoginFailed="index.cfm?login=failed">
<cfquery name="MM_rsUser" datasource="#Request.MainDSN#">
SELECT username,password,priv FROM clients WHERE
username=#argument.username# AND password=#argument.password#
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=#argument.username#>
<cfset Session.MM_UserAuthorization=MM_rsUser.priv[1]>
</cflock>
<cfif IsDefined("URL.accessdenied") AND false>
<cfset MM_redirectLoginSuccess=URL.accessdenied>
</cfif>
<cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
<cfcatch type="Lock">
<!--- code for handling timeout of cflock --->
</cfcatch>
</cftry>
</cfif>
<cflocation url="#MM_redirectLoginFailed#" addtoken="no">
<cfelse>
<cfset MM_LoginAction=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_LoginAction=MM_LoginAction & "?" &
XMLFormat(CGI.QUERY_STRING)>
</cfif>
</cfif>
</cffunction>
</cfcomponent>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation