cancel
Showing results for 
Search instead for 
Did you mean: 

Redirect to google home app when user disagree on consent page (authorization code flow)

MrTest444555
Community Member

I have created the a oauth  web page UI that works with authroization code flow
First  as soon as user clicks on works with google on google home app, I opens up my authorize url  displaying my UI.
In UI im showing a consent popup which has agree and cancel button.
when user click on Agree he will allowed to enter phone number and proceed with flow. Im using one redirect uri to share authorization code.
But when user click cancel how can i redirect user back to the google home app ?
Does google provide any redirection link to redirect user back google home app ?

I have refer documention i couldnt find one that elaborates on this. 
 

1 Recommended Answer

GoogleDevForum
Solutions Expert
Solutions Expert

Google Home app does not provide a specific redirection link for navigating back to the Google Home app after a user cancels during the OAuth consent flow. However, you can handle both success and cancellation scenarios using your redirect_uri.

When the user clicks "cancel" in your consent popup, you can redirect them back to the specified redirect_uri with a query parameter indicating that the action was canceled. This way, your system can detect the cancellation and respond appropriately.

Moreover, instead of providing a "cancel" button, consider just adding text that informs the user about the implications of signing in. For example:

"By signing in, you are authorizing Google to control your devices."

This approach helps streamline the user experience and ensures they are aware of the consequences of their actions without needing an explicit cancel option.

View Recommended Answer in original post

1 REPLY 1

GoogleDevForum
Solutions Expert
Solutions Expert

Google Home app does not provide a specific redirection link for navigating back to the Google Home app after a user cancels during the OAuth consent flow. However, you can handle both success and cancellation scenarios using your redirect_uri.

When the user clicks "cancel" in your consent popup, you can redirect them back to the specified redirect_uri with a query parameter indicating that the action was canceled. This way, your system can detect the cancellation and respond appropriately.

Moreover, instead of providing a "cancel" button, consider just adding text that informs the user about the implications of signing in. For example:

"By signing in, you are authorizing Google to control your devices."

This approach helps streamline the user experience and ensures they are aware of the consequences of their actions without needing an explicit cancel option.