function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MDeveloperMDeveloper 

Need Captcha Implementation Information in community site

hi,

 

i want to implement captcha in community site but i don't have any idia how to do it please help me

Satish_SFDCSatish_SFDC
There is an article which should help start with Captcha

http://wiki.developerforce.com/page/Adding_CAPTCHA_to_Force.com_Sites

Hope this helps.

Regards,
Satish Kumar
MDeveloperMDeveloper

Hello Satish,

 

Thanks for your reply. i have try this. but there is some confusion. i am using site.com  community  CMS. i want to implement captcha in site.com but site.com does not provide any interface for coding then how can i implement captcha.

Ashish_SFDCAshish_SFDC

Hi , 

 

 

Check the user permissions and other info in the below link, 

 

https://help.salesforce.com/apex/HTViewHelpDoc?id=siteforce_communities_using.htm&language=en_US

https://help.salesforce.com/apex/HTViewHelpDoc?id=siteforce_communities_overview.htm&language=en_US

 

Regards,

Ashish

 

MDeveloperMDeveloper

I don't think it helps.

Ashish_SFDCAshish_SFDC

Hi , 

 

In the Edit for Site.com page, Click on Login Page | under Registration: Check the box | Allow external users to self-register |

 

Customize Self Registration page and the Controller available in the link with the captcha code. 

 

To publish the Site you would need additional publisher license, please see the links in this post and the previous posts. 

 

https://help.salesforce.com/apex/HTViewHelpDoc?id=siteforce_perm_license_about.htm&language=en

https://help.salesforce.com/htviewhelpdoc?err=1&id=networks_customize_login.htm&siteLang=en_US

 

Regards,
Ashish

ericmonteericmonte

MDeveloper, where do you want the capcha in your site.com page? is it for everytime they enter information in the communities?

ericmonteericmonte

MDeveloper, i see your problem in regards to captcha and Site.com. I don't see a way where you can just drag and drop the captcha component in Site.com Studio. What you need to do is create the captcha in a VF page and use an iframe for that page into your site.com studio, but the iframe doesnt really get referenced back and forth between your standard page elements in the page. If you are able to make that happen then you are golden.

 

In the end you might have to do the following:

1. Create all your forms into a visualforce page and add captcha to it based on Pat Patterson's blog.

2. Tthen publish that page it in your force.com sites within your communities.

3. Then in your Site.com Studio you can create page element with html code and use an iframe to reference that force.com site page with captcha.

 

Does this make sense?

 

I'm assuming that your site.com page has an unauthenticated portion to it where public user can post record into your instance? If this was an authenticated user where user's log ing  then you wouldn't even have to worry about captcha.

Ashish_SFDCAshish_SFDC

Hi MDeveloper, 

 

You may also try this,

And here is the code, first the page:

<apex:page controller="captcha" >
 
    Enter only the <strong>black</strong> characters.
    <apex:outputPanel styleClass="container" layout="block" id="code">
        <apex:outputText value="{!char1}" styleClass="blackChar"/>
        <apex:outputText value="{!char2}" styleClass="redChar"/>
        <apex:outputText value="{!char3}" styleClass="blackChar"/>
        <apex:outputText value="{!char4}" styleClass="redChar"/>
        <apex:outputText value="{!char5}" styleClass="blackChar"/>
        <apex:outputText value="{!char6}" styleClass="redChar"/>
    </apex:outputPanel>
 
    <apex:form >
        <apex:inputText value="{!input}"/>
        <apex:commandButton action="{!validate}" value="Validate" rerender="result"/>
        <apex:commandButton value="Reset" rerender="code"/>
    </apex:form>
 
    <apex:outputPanel id="result">
        {!result}
    </apex:outputPanel>
 
    <style>
        .redChar{
            color: #C30000;
            font-size: 24px;
            padding:5px;
        }
        .blackChar{
            color: black;
            font-weight: bold;
            font-size: 24px;
            padding:5px;
        }
        .container{
            background-color: #E8E8E8;
            border-style: solid;
            border-width:1px;
            width: 150px;
            text-align: center;
        }
    </style>
</apex:page>
Ashish_SFDCAshish_SFDC

And next the controller:

public class captcha {
 
    List<String> characters;
    public String input {get; set;}
    public String result {get; set;}
    String char1;
    String char3;
    String char5;
 
    //In our contructor we will populate a list of strings with numbers and letters
    public captcha(){
        characters = new List<String>{'a','b','c','d','e','f','g','h',
            'i','j','k','l','m','n','o','p','q','r','s','t','u','v','w',
            'x','y','z','1','2','3','4','5','6','7','8','9','0'
        };
    }
 
    //This methods simply returns a random number between 0 and the size of the character list
    public Integer randomNumber(){
        Integer random = Math.Round(Math.Random() * characters.Size());
        if(random == characters.size()){
            random--;
        }
        return random;
    }
 
    /*Here we have 6 get methods that return 6 random characters to the page.
    For chars 1,3, and 5 (the black characters) we are saving the the values so 
    that we can compare them with the user's input */
    public String getChar1(){
        char1 = characters[randomNumber()];
        return char1;
    }
    public String getChar2(){
        return characters[randomNumber()];
    }
    public String getChar3(){
        char3 = characters[randomNumber()];
        return char3;
    }
    public String getChar4(){
        return characters[randomNumber()];
    }
    public String getChar5(){
        char5 = characters[randomNumber()];
        return char5;
    }
    public String getChar6(){
        return characters[randomNumber()];
    }
 
    /*In the validate method we make sure that the 3 characters entered equal the three black characters: char1, char3, char5*/
    public void validate(){
        if(input.length() == 3 && input.subString(0,1) == char1 && input.subString(1,2) == char3 && input.subString(2,3) == char5){
            result = 'Whoohoo! You got it right.';
        }else{
            result = 'Come on...the letters aren\'t even disfigured.'; 
        }
    }
}

 

http://www.tehnrd.com/simple-visualforce-captcha/

 

Regards,

Ashish

ericmonteericmonte

Ashish, this works great using VF page and Force.com Sites, but you can't really integrated that VF page into Site.com. I believe this is the limitation MDeveloper and I are having.

 

Here i my scenario:

1. I have an unauthenticated page that allows user to send Lead information.

2. Using Site.com, i can easily add the fields and required fields to my page creating a web form.

3. I want to add a CAPTCHA in my web form, so my instance doesnt get SPAMMED without custom coding using VF pages and controllers. 

 

Your solution above states, I need to create a VF Page and controller to handle the captcha, but how would one integrate the Site.com page to this VF page? You also can't just drag and drop a VF page into the templates, you would have to use iframe and pass data.

Ashish_SFDCAshish_SFDC

Hi Eric, 

 

The Site.com in Communities is focussed on Declarative Site building without using code and looks we need a inbuilt component which can be used by Drag and Drop on the Communities built site.com page. 

 

As the feature is currently not available and there is a need that will arise with more and more users building sites on Communities, i would request you to log an idea in our Ideas exchange which will be looked up (#Safeharbour) and worked upon for future releases based on the votes and the need significance. 

 

https://success.salesforce.com/ideaPost

 

Regards,

Ashish

 

 

Ruben PeresRuben Peres
Go to the reCAPTCHA homepage and click on the Get reCAPTCHA button at the top of the screen. On the next screen, you'll find a prompt to enter a label and domain for your site (https://bit.ly/3KpcP2K) , so you can identify it among your reCAPTCHA properties. Populate both fields, click on Register, and you're done.
Alex Toba 10Alex Toba 10

CAPTCHA, or Completely Automated Public Turing test to tell Computers and Humans Apart, is a common security measure used to protect websites from malicious bots. It works by presenting users with a special code or image that only humans can read, preventing automated scripts from accessing sensitive parts of your website.

In a community website, CAPTCHA can be used in two ways:

1. As a form of authentication. CAPTCHA can be used to verify that the user is a real person, as opposed to a bot, before they can access certain parts of the website. This can help to reduce spam and malicious activity on the site (https://spotifymod.com).

2. As a form of verification. CAPTCHA can be used to verify that the user has correctly input the requested information, such as an email address. This can help to ensure that the user is not providing false information.

When implementing Captcha on your community website, it is important to consider the user experience. CAPTCHA can be difficult for some users to understand and use, so it is important to make sure that it is easy to understand and use. Additionally, it is important to ensure that the CAPTCHA is secure and difficult for bots to bypass.

It is also important to ensure that the CAPTCHA is accessible to all users, including those with disabilities. This can be done by using an accessible CAPTCHA system, such as reCAPTCHA.