Sachin Singh

Sachin Singh

  • 8
  • 55.8k
  • 81k

How to generate Client Id and Secret (best practise)

Aug 24 2020 10:14 PM
I am using Client Credential Flow like below
  1. public override Task ValidateClientAuthentication(OAuthValidateClientAuthenticationContext context)  
  2.     {  
  3.         string clientId;  
  4.         string clientSecret;  
  5.         context.TryGetFormCredentials(out clientId, out clientSecret);  
  6.    
  7.         if (clientId == "qwe32" && clientSecret == "fgg45")  
  8.         {  
  9.             context.Validated(clientId);  
  10.         }  
  11.    
  12.         return base.ValidateClientAuthentication(context);  
  13.     } 
  1.  what is the best way to generate Client Id and Secret (my approach:- Guid/RandomNumber +Encryption)
  2. How to provide Client Id and Secret to API Client (like Fb/Google has developer dasboard) ,do we need to create a dashboard ?

Answers (1)