Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Hi @Kha-N , @Sayali-MSFT ,
We had achieved certificate base authentication:
Below are code for reference :
`@Primary @Bean public CertificateAppCredentials certificateCredentials(SpringBotAppCredentials credentials) { return credentials.getAppCredentials(); }
@Bean
public TeamsConnectorClient restTeamsConnectorClient(CertificateAppCredentials credentials) {
return new RestTeamsConnectorClient("https://smba.trafficmanager.net/uk/", credentials);
}
@Bean
public BotFrameworkAdapter botFrameworkAdapter(
CertificateAppCredentials withCredentials,
AuthenticationConfiguration withAuthConfig,
ChannelProvider withChannelProvider) {
Configuration conf = getConfiguration();
String clientId = conf.getProperty("MicrosoftAppId");
withCredentials.setAppId(clientId);
BotFrameworkAdapter adapter = new BotFrameworkAdapter(withCredentials,
withAuthConfig,
withChannelProvider,
null,
null);
return adapter;
}
`
and in extends TeamsActivityHandler we need to set teamsConnectorClient
turnContext.getTurnState().remove(BotFrameworkAdapter.TEAMSCONNECTOR_CLIENT_KEY);
turnContext.getTurnState().add(BotFrameworkAdapter.TEAMSCONNECTOR_CLIENT_KEY, teamsConnectorClient);