Showing posts with label Security. Show all posts
Showing posts with label Security. Show all posts

Thursday, May 28, 2015

Interface between systems - call to WS\ WCF service from CRM FAILED because Https request (validation errors)

Interface between systems - call to WS\ WCF service from CRM FAILED because Https request (validation errors)
The solution is to add the next code in plugin

  bool CertificateValidationCallBack(
    object sender,
    System.Security.Cryptography.X509Certificates.X509Certificate certificate,
    System.Security.Cryptography.X509Certificates.X509Chain chain,
    System.Net.Security.SslPolicyErrors sslPolicyErrors)
        {
            // If the certificate is a valid, signed certificate, return true.
            if (sslPolicyErrors == System.Net.Security.SslPolicyErrors.None)
            {
                return true;
            }
            // If there are errors in the certificate chain, look at each error to determine the cause.
            if ((sslPolicyErrors & System.Net.Security.SslPolicyErrors.RemoteCertificateChainErrors) != 0)
            {
                if (chain != null && chain.ChainStatus != null)
                {
                    foreach (System.Security.Cryptography.X509Certificates.X509ChainStatus status in chain.ChainStatus)
                    {
                        if (//(certificate.Subject == certificate.Issuer) &&
                           (status.Status == System.Security.Cryptography.X509Certificates.X509ChainStatusFlags.UntrustedRoot))
                        {
                            // Self-signed certificates with an untrusted root are valid.
                            continue;
                        }
                        else
                        {
                            if (status.Status != System.Security.Cryptography.X509Certificates.X509ChainStatusFlags.NoError)
                            {
                                // If there are any other errors in the certificate chain, the certificate is invalid,
                                // so the method returns false.
                                return false;
                            }
                        }
                    }
                }
                // When processing reaches this line, the only errors in the certificate chain are
                // untrusted root errors for self-signed certificates. These certificates are valid
                // for default Exchange Server installations, so return true.
                return true;
            }
            else
            {
                // In all other cases, return false.
                return false;
            }

        }

View Class 


Enjoy,
Rami Heleg

Tuesday, February 7, 2012

Multiple Forms for Each Entity

A new feature in CRM 2011 has been added is Multi Forms.

Multi forms used to create and custom Main page and change the layout for each forms.

The example for this feature if customer has a few Business Unit and each one of them should see case (incident) with a different fields (different layout)

Example:
Define the form layout
  Assign security roles to view the forms

Publish the changes and connect with user assign to security role. (Need to remove the default Main Form from the relevant security role.
1.       In summary this feature ( I think this is more the standard feature) very very useful to develop a good program from correct customer structure
Enjoy,
Rami Heleg

Field security Profile

Field security Profile

A new feature in CRM 2011 has been added is Field Security Profile

This option manages view\hide\edit fields.

The feature is very used because in CRM 3, 4 we used to hide fields and now it is in the box

Example:

1.       Create a new field and change the property Field Security = Enable


2.       Add field to entity

1.       Publish the change and view the field.
2.       Now the next step is to define the authorization
3.       Open solution and select field security Profiles, create a new record like next example:
 

set name and description
Define permission for the field. (Get this field because was defined has security field
In this example I add users for this example but because I use a diffident user which not added user should see the value
Enjoy
Rami Heleg.