I am having python script that will produce a csv file. I want to upload this to onedrive. When I searched, the first step itself is to create an application in Azure portal. But I can't create application because I don't have access to that feature.
So this is my workaround,
--I am not sure is this the supposed way--
I have gone to Graph explorer. When I run the query I got client request ID and Access token. Using this I will make a curl request like
curl.exe https://graph.microsoft.com/v1.0/me/drive/root:/folderA/file.csv:/content -H "Content-Type:plain/text" -H "Authorization: Bearer access-token-here" -X PUT -H "client-request-id: client-request-id-here" --data-binary "@path/to_file.csv"
I am sure if it is working with curl, I can surely make it work using some Python library.
There are two challenges:
Access token will expire soon. so I want to implement refresh token, The example provided in this doc is not suiting my use case https://docs.microsoft.com/en-us/graph/auth-v2-user
Is giving access token in script a security issue, how can I overcome this.