You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## How To Use Auth Service To Get Permission From a Google Account
57
+
#### Step 1. Request Authorization Code
58
+
```cs
59
+
privateasyncTaskRequestCode()
60
+
{
61
+
List<Scope>scopes=new();
62
+
scopes.Add(Scope.OAuth2Email); //Not required, but useful for get user email in future.
63
+
scopes.Add(Scope.Calendar);
64
+
awaitAuthService.RequestAuthorizationCode(AuthService.GetClientId(), scopes, NavigationManager.BaseUri+"v1/browser-callback"); //"v1/browser-callback" is your page that method returns and opens the page as a new tab
65
+
}
66
+
```
67
+
#### Step 2. Get Access Token With Obtained Authorization Code in Step 1
#### Step 3. You can store this access token (can also obtain refresh token etc. with same way) in your database or make a cookie. You can use this token to call calendar, drive etc. features.
92
+
93
+
94
+
## How To Create a Calendar Event
95
+
#### Make an instance of GoogleCalendarEventModel and add it. Notice that for datetimes like event start and end, need to use GetProperDateTimeFormat method.
// If you don't know the id of calendar which will the event be added, use FindCalendarId method. In this case, the event added the calendar which has "Test Calendar" title.
0 commit comments