Click here to Skip to main content
16,015,481 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i have tried to post message in teams channel by using username and password with delegated permissions. but i am getting error. i am using certificate authentication for my tenant id and client id while setting up graph api client. but how to authenticate for username and password with delegated authentication?

What I have tried:

var graphClient = new GraphServiceClient(requestAdapter);

var requestBody = new ChatMessage
{
	Body = new ItemBody
	{
		Content = "Hello World",
	},
};
var result = await graphClient.Teams["{team-id}"].Channels["{channel-id}"].Messages.PostAsync(requestBody);
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900