Google One Tap Sign In for subdomain - subdomain

i want to ask about implement google one tap sign in, into subdomain
first of all, i already add one tap into main domain
let's say, https://www.example.com. and this domain is registered on google console
i wanna put the one tap sign in into my subdomain, let's say : https://sub1.example.com
on the documentary, they said use this code
You can use the data-state_cookie_domain configuration parameter to change the state cookie domain. The following code example shows how to set the data-state_cookie_domain parameter:
<div id="g_id_onload"
data-client_id="YOUR_CLIENT_ID"
data-auto_select="true"
data-state_cookie_domain="parentdomain.com"
data-login_uri="https://login.parentdomain.com/your_login_endpoint">
</div>
I already trying the code, but it not successfull.
Error message is still same, The given origin is not allowed for the given client ID.
How can I implement this into subdomain?
Thanks

Related

Docusign redirect url with dynamic domain name

currently my local account have different domain like "http://tester.company-dev:8080" , when ever i create an account i will get different domain . how will i set the redirect url in setting page in docusign so that it will redirect me to correct domain url . is it possible to pass a parameter to redirect_url something like below :
"http://{domain}.company-dev:8080/ds/callback" and i need to pass the domain value
here domain=tester
I assume you mean the URL for OAuth, mostly used for Auth Code Grant to redirect users back to your app with the code needed to obtain an access token.
You would have to know all the possible URLs and add them to your IK. There's no way to make this dynamic. This is arequirement of OAuth2.0 specification, it's a security issue and you have to have a matching URL. If there's a reason you cannot do that, we can suggest alternate solutions that may involve not using Auth Code Grant and/or some redirect scheme from a fixed URL to one of these dynamic ones.

Is there a way to customize the 403 message using Google Auth?

When I log in with an account which does not belong to the expected domain, this message is shown (which is correct).
I think this message is kind of ugly and not understandable for a non-developer person. Is there a way to modify this message in the Google Cloud Console or inside the OAuth code? I would like to display for example:
The email you used does not belong to the happy.com domain.
I fount this Feature Request In the Public Issue Tracker, and there they suggest to follow the steps of Customize the rejected-app message. Basically it mentions:
Your current account, user#domain.com, doesn't have permission to do these steps. To continue, switch to an administrator account. This will open the Google Admin console.
Switch to administrator account now or Learn more
From the Admin console Home page, go to "" and then Security and then API controls.
Under App access control, go to the Settings section.
Type your custom text in the box under the following message: Show this message if a user tries to use an app that can’t access restricted Google services.
Click SAVE.
If this doesn't make it, I would recommend you to comment on that FR in which they mentioned:
I have filed this feature request internally.
You might also want to ‘star’ the FR to ensure that you receive updates about it. You can also adjust notification settings by clicking the gear icon in the top right corner and selecting settings.

Restricted Scopes OAuth verification

I have received a mail from noreply-apps-developer#google.com with the subject “[Action Required] Submit your app(s) for Restricted Scopes OAuth verification”. In the email body, there is a link to the Google API Console. After I am in the Google API Console, under the tab named “Credentials” 2 fields are highlighted.
Following is the screenshot of the same.
Link to screenshot
I would like to know the reason for the error “Invalid domain”. Also, would be great if you can help me resolve the issue.
Please note: In the sections highlighted in red color, the site URL is present. I have removed it from the screenshot for security concerns.
Edit1:
As suggested, I have added the links for privacy policy, domain, etc. When I click on the "Submit for verification" button, a modal appears. I am unable to identify what information I need to add here. The details are as follows:
link for the screenshot of the modal which appears when I click on the submit button.
The application interacts with gmail in 2 instances:
1. Sending emails.
2. Reading emails received (emails having a particular subject line) and accessing the attachments present in it.
There is not other use of the gmail connectivity.
I am confused whether I should mark the application as "Internal" or should I submit it for verification. If I have to submit it for verification, then what details should I insert in the modal that appears on click of the "submit for verification" button (screenshot has been shared).
Request you to help me resolve the issue.
All URLs in your project must match one of your Authorized Domains. But your screenshot shows this field to be blank. You will need to tell Google which domains your app is allowed to run on.
For example, let's assume your homepage is at https://www.example.com/ and your privacy policy is at https://www.example.com/privacy. You'll need to include example.com in the first field under Authorized Domains.
In this screenshot below, I've added a matching Authorized Domain and the errors are resolved.
Check the "Learn more". It was stated in bold text that:
Add your Authorized Domains before you add your redirect or origin URIs, your homepage URL, your terms of service URL, or your privacy
policy URL.
Looking into your screenshot, something is missing and it is your Authorized domains.

Issue with Gmail addon needing dynamic auth url

We are creating a Gmail add-on that integrates with a CRM product. The product is single-tenant and every client has their own site path under our domain. Each client also has their own path to authorize with, e.g. https://example.com/siteA/oauth/authorize.
When setting up the custom auth screens, it looks like we are expected to know the url to assign to a click event on the auth button.
authButton2 = CardService.newTextButton().setText('Begin Authorization!')
.setAuthorizationAction(CardService.newAuthorizationAction()
.setAuthorizationUrl(authurl));
I would like to have some user input before this point. I was playing with an input field where the user could type their site name an then click the authorize button although I was not able to overwrite the original authurl supplied to the setAuthorizationUrl method.
Ideally it would be nice if the add-ons had a way to store some one-time input (like "site name" in this example) so we would not have to ask again, but I have not found anything like this.
This seems like we need a central auth endpoint but am trying to avoid this.
Anyone have any experience with this or any ideas?
Just build the authorization button using the proper url after you get it from the user input.
You can't modify that button once you create it. Rather than modify it, just create the button after you receive the url and reload that card. Or put the authorization button a new card that you push to the top once you receive user input on the auth url.

Google MAP API | Push Notification for Website

I am using Google Maps API for a project whose functionality is something like below
Functionality achieved:
When user sign in they see map and their current location is traced. Users can mark their favorite location and add a comment.
Functionality required and I need help in:
When any user passes through any location in real time, then my web application should send a notification saying "you are someone's favorite place do you want to add comment and xyz..."
Can anyone help me even with a hint on how I can achieve this for the web application?
P.S: I am not using any mobile application for this purpose. This is a web application.
It sounds like you're already set up with getting the user's location through the browser geolocation api when the page loads. My suggestion is to get the user's location again on a certain interval, every couple minutes maybe. If the new location is more than a little bit different than the previous location, send an ajax request to your server, see if the new location is near one of these favorite places, and if so, display a notification that they are near this place.