Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Script]: Google-Meet-Scheduler #3095

Closed
1 of 3 tasks
vishnu-v-vardhan opened this issue Jan 21, 2024 · 1 comment · Fixed by #3094
Closed
1 of 3 tasks

[Script]: Google-Meet-Scheduler #3095

vishnu-v-vardhan opened this issue Jan 21, 2024 · 1 comment · Fixed by #3094

Comments

@vishnu-v-vardhan
Copy link
Contributor

Aim

To simplify the OAuth authentication and terminate reliance on pickle module to make the code more redundant while retaining the core functionality.

Details

#3094
The latest code features the following code to handle authentication:
`def _auth():
creds = None
if os.path.exists("token.json"):
creds = Credentials.from_authorized_user_file("token.json", SCOPES)
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file(
"credentials.json", SCOPES
)
creds = flow.run_local_server(port=0)
# Save the credentials for the next run
with open("token.json", "w") as token:
token.write(creds.to_json())

    service = build("calendar", "v3", credentials=creds)
    return service`

A global variable 'SCOPES' is used to define "https://www.googleapis.com/auth/calendar".

Record

  • I agree to follow this project's Code of Conduct
  • I'm a GSSoC'23 contributor
  • I want to work on this issue
Copy link

To reduce notifications, issues are locked. Your issue will be unlocked when we add the label gssoc23. If you're participating in GSSoC'23, please add the gssoc23 label to your issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant