> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Discovery Authenticate

> Authenticate using discovery OAuth with the Stytch React SDK

`oauth.$provider.discovery.authenticate()` wraps the [Authenticate Discovery OAuth](https://stytch.com/docs/api-reference/b2b/api/oauth/discovery/authenticate.md) API endpoint which validates the OAuth token passed in. If this method succeeds, the Intermediate Session (A session token designed to preserve state when the user has completed an initial authentication step, but has not fully authenticated into an Organization.) 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

**discovery\_oauth\_token** `string` *required*

The Discovery OAuth token to authenticate.

```jsx theme={null}
import { useEffect } from 'react';
import { useSearchParams } from 'react-router';
import { useStytchB2BClient } from '@stytch/react/b2b';

export const DiscoveryAuthenticate = () => {
  const stytch = useStytchB2BClient();
  const [searchParams] = useSearchParams();

  useEffect(() => {
    const token = searchParams.get('token');
    if (token) {
      stytch.oauth.google.discovery.authenticate({
        discovery_oauth_token: token,
      });
    }
  }, [stytch, searchParams]);

  return <div>Authenticating...</div>;
};
```
