• Axel Martínez Millán
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hello everyone!

I am trying to create a Custom Auth Provider by creating a class that implements Auth.AuthProviderPlugin. I just copied the example shown in the documentation for the API 38, the one I am using, and I tried following the guide at https://help.salesforce.com/articleView?id=sso_provider_plugin_custom.htm&language=en_US&type=0 . 

Unfortunately, when I was creating the Auth Provider in SalesForce, I received the following error:

'Custom Metadata Type is either invalid or null . Check the returned type for getCustomMetadataType() method'
I have tried using different kinds of return values ('CustomSSO__mdt', 'CustomSSO'...) for getCustomMetadataType() and I have checked thoroughly that the Custom Metadata Type exists and the API Name is the one used in getCustomMetadataType().

I have ended up with just this code as the provider plugin, trying to remove as much as I could from the given example, ending up just with the basic skeleton for the plugin:

global class CustomSSOProviderPlugin implements Auth.AuthProviderPlugin {  
    
               global String getCustomMetadataType() {
                   return 'CustomSSO__mdt';
               }
       
               global PageReference initiate(Map<string,string> authProviderConfiguration, String stateToPropagate) {
                   return null;
                }
        
               global Auth.AuthProviderTokenResponse handleCallback(Map<string,string> authProviderConfiguration, Auth.AuthProviderCallbackState state ) {
                   return null;
                }
    
    
                 global Auth.UserData  getUserInfo(Map<string,string> authProviderConfiguration, Auth.AuthProviderTokenResponse response) { 
					return null;             
                 }
                
                global String getTokenValueFromResponse(String response, String token, String ns) {
					return null;
                }  
    
}
I'm pretty sure that I've followed the guide on the SalesForce docs properly, but I can't get past this one error.
 
User-added image

If anyone has any idea of how can this solved, help would be very appreciated!

Thanks in advance!