Get the Role, Grade,School name of Logged in user from Google API - google-api

I have integrated Google sign-in in our application, I need to check whether the logged in user is a teacher or student ,Organisation(school) name and Grade... Is there any API to get these details from Google and how to get the details form Google.

Regarding whether a user is a student or a teacher, see this answer.
It's not possible to determine the grade or school name via the Classroom API. (Please add a feature request for this so we can judge whether it's something a lot of developers would find useful!)

Related

How do I get a user's organization id when they login with Microsoft oauth?

I try to implement the microsoft auth into my application using Laravel Socialite, but since I'm working in a multi-tenant environment, I need to assign a user to a organisation. Is there anything such a microsoft organisation id or a domain name I can access in the docs? I'm unable to find it in the docs.
Also I try to get the street, postal and city and wasn't able to access that as well, but this is not as critical as the company identifier.
I found this thread, but it handles over Google, so maybe the approach might be similar:
How do I get a user's organization id when they login with Google oauth?
As I searched, I also found this docs, which seems to list all available fields of oauth: https://learn.microsoft.com/de-de/azure/active-directory/develop/id-tokens
https://learn.microsoft.com/en-us/graph/auth-v2-user#4-use-the-access-token-to-call-microsoft-graph
According to this docs: https://learn.microsoft.com/en-gb/previous-versions/azure/ad/graph/howto/azure-ad-graph-api-permission-scopes you can add tenant details to the request including the id, display name and verified domains.

How can i find my AccountId for my Zoho account?

Im trying to make some API calls for Zoho, like Email API.
But i am not able to make a valid request due to not knowing my Account Id.
Note that i know my User Id which i can find from my profile section in Zoho.
How can I find my Account Id?
Notes:
I tried calling this API, but getting an error.
http://mail.zoho.com/api/accounts
The error I get:
{"data":{"errorCode":"INVALID_TICKET","moreInfo":"Invalid ticket"},"status":{"code":400,"description":"Invalid Input"}}
Thanks!
Zoho's documentation explanation of account id:
"Each user might have more than just one account associated with their Zoho Mail account. They might have added several POP accounts that can be accessed from the Zoho Mail interface. Each account that you associate with a Zoho account will have a separate Account ID. You'll need the account ID while passing several user and account related API requests. The account ID for each account associated with a Zoho account can be retrieved using the Organization User Details API. You will need the OrgID to fetch the User account details using this API."
And the organization user details api mentioned is this
https://www.zoho.com/mail/help/api/get-org-users-details.html
And here you can see you get the account id
enter image description here

Google Sign-in identify account tied to a school

I'm using Google Sign-in to register and login users to my web app.
We are an edtech product, so I would like to make sure users are registering with a google account that is tied to a school and not using their personal google accounts.
Is this possible?
I don't see a field in user that would indicate this. I also can't find confirmation as to whether or not school google accounts can have an #gmail.com email or if they must use a custom domain.
Note that these account may or may not be using Google Classroom, so I can't rely on that.
Unless you have a List of the "school" accounts and can test against that there is no way for you to know.
Google is not going to tell you if its a school google account. They may know if its a google classroom account but that kind of information is not shared at login time. Probably due to user privacy.

Google apps for education get user organizationUnit

The People API with 'me' is supposed to give organizations. But found that the organizations comes from user entered Google plus.
I want to find current logged in users Organization Unit under which the admin added them. I am building a Marketplace app, where based on if the user is teacher or a student, the functionality is allowed or restricted.
What is the best way to get this info?

How do I programmatically determine a Google Account USERID token from a Gmail address without credentials?

I'm developing something with the Google Books API, but I think this can be generalized across many of Google's APIs.
Suppose I have an app that's got a social aspect where I can add friends and see their Google Books collection. From the API docs, it says I can retrieve anybody's collection if I know their userid, but I can't find any way to retrieve it programmatically. The only thing I can expect a user to know is their friend's gmail address (or Google Account Login, which, for these purposes, is the same thing). The only way I can somehow get it is through a URL on their web interface for Google books. Making users do it that way is an obscure form of torture.
Does anyone know if this is possible with any Google service?
Specifically, suppose I had a gmail address: example#gmail.com, could I then query some Google service to get the userid for that user? A userid is a basically a really big number (around 20 digits)
Here's a similar question with a solution/workaround from Nick Johnson:
The current workaround is to create a
User object, store it to the
datastore, and fetch it again. If the
email corresponds to a valid Google
account, the User object in the
returned entity will have its user_id
field populated.

Resources