Presently i am working on google classroom API to integrate classroom into my .NET product.I am using below method for authenticating user.My problem is when i execute this code it asking authentication for first time but when i execute this code next time it directly log in as previous log in credentials.When i try this after many days and many browsers also directly log in as first authenticated user.But for every fresh time execution of code i want it ask for authentication of user rather than directly log in as previous user credentials.How to achieve this...? I am new to this OAuth and API's.Your valuable answer will help my team a lot.
please any one help me on this...
private ClassroomService getservice()
{
using (var stream =
new FileStream(Server.MapPath("client_secret1.json"), FileMode.Open, FileAccess.Read))
{
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
Scopes,
"user",
CancellationToken.None).Result;
}
var service = new ClassroomService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = ApplicationName,
});
return service;
}