<@U04UQ68083H> how can I get the sign in with goog...
# ory-copilot
l
@chilly-king-10285 how can I get the sign in with google prompt to open in a new window when the user clicks on the button during login?
b
A message from kapa.ai
To open the Google sign-in prompt in a new window when the user clicks the button during login, you need to implement a specific approach for native and mobile apps. Here's how you can achieve this: 1. For native and mobile apps, you should use a browser window that opens when the user clicks the social sign-in button. This can be done using [ASWebAuthenticationSession](https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession) on iOS or [Custom Tabs](https://developer.chrome.com/docs/android/custom-tabs/) on Android [Social sign-in for native and mobile apps](https://www.ory.sh/docs/kratos/social-signin/native-apps). 2. In your application, you need to implement a button that triggers the social sign-in process. Here's an example of how to structure the form for social sign-in:
Copy code
html <form action={flow.action} method={flow.method}>     <button type="submit" value="google">Sign in with Google</button> </form>
[Bring-your-own-ui > Advanced integration > Login > Social sign-in](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-advanced-integration#login) 3. When the button is clicked, you should use a method to open the authentication URL in a browser. For example, in React Native with Expo, you can use `WebBrowser.openAuthSessionAsync`:
Copy code
javascript WebBrowser.openAuthSessionAsync(url, redirectUrl)
[Social sign-in for native and mobile apps > Implementation](https://www.ory.sh/docs/kratos/social-signin/native-apps#steps-6-12-open-the-identity-provider-authentication-url-in-a-browser) This method will open the Google sign-in prompt in a new browser window or tab, allowing the user to authenticate and grant access to their profile information. Remember to configure the Google social sign-in provider in your Ory project and set up the necessary OAuth 2.0 credentials in the Google Cloud Console, as described in the [Google social sign-in documentation](https://www.ory.sh/docs/kratos/social-signin/google). By following these steps, you can ensure that the Google sign-in prompt opens in a new window when the user clicks the sign-in button during the login process.