I was trying to build a market place application with admin-sdk.
Reading the docs, it looks like two legged authentication is the only way to go as far as market place apps are concerned.
Wanted to check if the current user is an admin so for that, I wanted to use
https://www.googleapis.com/admin/directory/v1/users/(useremail)?xoauth_requestor_id=(admin-email)
I was trying both to be the same and to be that of the admin
The Authorization header is also as follows.
OAuth realm="", oauth_signature_method="HMAC-SHA1",
oauth_version="1.0", oauth_consumer_key="<key from market place>",
oauth_nonce="4473365854789985180", oauth_timestamp="1380453874",
scope="https://www.googleapis.com/auth/admin.directory.user",
oauth_signature="yEcbWIp5f1nNFaUI8vSxn1NYlzw="
When this request is made to the url I am getting error saying.
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization"
I looked for apis to get it done but could not find for two legged with admin-sdk. Could someone please help me tackle the problem ?
Also can such a feature be done by using service accounts ?
I also wanted to, in the end have the admin-sdk to be used golang in the end.