Localised message for RestAPI error response in B2C custom policy

后端 未结 1 1725
囚心锁ツ
囚心锁ツ 2021-01-28 07:42

I did localisation in my custom policy, but in certain steps I\'m calling REST API to validate some data. Response is coming in English, but now I need to translate that message

1条回答
  •  Happy的楠姐
    2021-01-28 08:19

    You can send the localisation parameter to the REST API and have it return a localised error. Or you can return back an error code from the API instead of an error string. Then use the following example to have this done in policy:

        
            
                
                    errorCode
                    string
                    A claim responsible for holding response codes to send to the relying party
                
                
                    Message
                    string
                    A claim responsible for holding response messages to send to the relying party
                    Paragraph
                    
                        
                        
                    
                
            
            
                
                    
                         
                    
                    
                        
                    
                
                
                    
                        
                    
                    
                        
                    
                
            
            
                
                    
                        
                        
                    
                
            
            
                
                    en
                    es
                
                
                    
                        
                            
                            
                        
                    
                
                
                    
                        
                            
                            
                        
                    
                
            
        
        
            
                Self Asserted
                
                    
                        User profile
                        
                        
                            api.selfasserted
                        
                        
                            
                            
                        
                        
                            
                        
                        
                            
                            
                        
                    
                
            
        
        
            
                
                    
                        
                            
                        
                    
                    
                        
                            
                        
                    
                    
                
            
        
    

    0 讨论(0)
提交回复
热议问题