import { useEffect } from 'react';import { View, Text } from 'react-native';import { useStytchB2BClient } from '@stytch/react-native/b2b';export const DiscoveryAuthenticate = ({ route }) => { const stytch = useStytchB2BClient(); useEffect(() => { // Extract token from navigation params or deep link const token = route.params?.token; if (token) { stytch.oauth.google.discovery.authenticate({ discovery_oauth_token: token, }); } }, [stytch, route]); return ( <View> <Text>Authenticating...</Text> </View> );};
import { useEffect } from 'react';import { View, Text } from 'react-native';import { useStytchB2BClient } from '@stytch/react-native/b2b';export const DiscoveryAuthenticate = ({ route }) => { const stytch = useStytchB2BClient(); useEffect(() => { // Extract token from navigation params or deep link const token = route.params?.token; if (token) { stytch.oauth.google.discovery.authenticate({ discovery_oauth_token: token, }); } }, [stytch, route]); return ( <View> <Text>Authenticating...</Text> </View> );};
Discovery
Discovery Authenticate
Authenticate using discovery OAuth with the Stytch React Native SDK
import { useEffect } from 'react';import { View, Text } from 'react-native';import { useStytchB2BClient } from '@stytch/react-native/b2b';export const DiscoveryAuthenticate = ({ route }) => { const stytch = useStytchB2BClient(); useEffect(() => { // Extract token from navigation params or deep link const token = route.params?.token; if (token) { stytch.oauth.google.discovery.authenticate({ discovery_oauth_token: token, }); } }, [stytch, route]); return ( <View> <Text>Authenticating...</Text> </View> );};
import { useEffect } from 'react';import { View, Text } from 'react-native';import { useStytchB2BClient } from '@stytch/react-native/b2b';export const DiscoveryAuthenticate = ({ route }) => { const stytch = useStytchB2BClient(); useEffect(() => { // Extract token from navigation params or deep link const token = route.params?.token; if (token) { stytch.oauth.google.discovery.authenticate({ discovery_oauth_token: token, }); } }, [stytch, route]); return ( <View> <Text>Authenticating...</Text> </View> );};
oauth.$provider.discovery.authenticate() wraps the Authenticate Discovery OAuth API endpoint which validates the OAuth token passed in. If this method succeeds, the token will be stored in the browser as a cookie.Use one of the following methods to authenticate a Discovery OAuth token:
oauth.google.discovery.authenticate()
oauth.microsoft.discovery.authenticate()
oauth.hubspot.discovery.authenticate()
oauth.slack.discovery.authenticate()
oauth.github.discovery.authenticate()
Parameters
string
required
The Discovery OAuth token to authenticate.
Assistant
Responses are generated using AI and may contain mistakes.