# Not able to use ts-react-google-login-component node package in plugin for authentication in 7.8 OSS version

**URL:** <https://discuss.elastic.co/t/not-able-to-use-ts-react-google-login-component-node-package-in-plugin-for-authentication-in-7-8-oss-version/247131>\
**Category:** Kibana\
**Created:** [September 1, 2020, 4:18pm UTC](https://discuss.elastic.co/t/not-able-to-use-ts-react-google-login-component-node-package-in-plugin-for-authentication-in-7-8-oss-version/247131 "2020-09-01T16:18:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jayanth\_Mogadampalli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jayanth_mogadampalli/32/74602_2.png) [@Jayanth\_Mogadampalli](https://discuss.elastic.co/u/Jayanth_Mogadampalli)\
**Post date:** [September 1, 2020, 4:18pm UTC](https://discuss.elastic.co/t/not-able-to-use-ts-react-google-login-component-node-package-in-plugin-for-authentication-in-7-8-oss-version/247131/1 "2020-09-01T16:18:36Z")

</div>

Right now, I am using elastic/kibana 7.8 OSS version code  
I am trying to implement authentication using Google auth by developing a plugin.  
For that I have installed the 'react-google-login' package using yarn and imported in component in plugin public folder.  
On running the Kibana, it is throwing content-server-policy violations in the console  
Can anybody help me to solve this issue or provide code for google OAuth

Here is the code:

```auto
         import { GoogleLoginButton } from 'ts-react-google-login-component';
          
        <GoogleLoginButton
           responseHandler={this.responseGoogle}
           clientConfig={clientConfig}
           preLogin={this.preLoginTracking}
           failureHandler={this.errorHandler}
         />

```

**throws following error:**

`Refused to load the script 'https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en.myOGgYJo9ys.O/m=auth2/rt=j/sv=1/d=1/ed=1/am=wQE/rs=AGLTcCMR2Cg_3Iqxcgmos-E9G6cjWQG_Kw/cb=gapi.loaded_0' because it violates the following Content Security Policy directive: "script-src 'unsafe-inline' 'unsafe-eval' 'self' https://apis.google.com/js/platform.js".`

on changing **csp.rules** to the below following way also didnt work

```
csp.rules:
  - "script-src 'unsafe-inline' 'unsafe-eval' 'self' https://apis.google.com/js/platform.js"
```

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [September 2, 2020, 3:56pm UTC](https://discuss.elastic.co/t/not-able-to-use-ts-react-google-login-component-node-package-in-plugin-for-authentication-in-7-8-oss-version/247131/2 "2020-09-02T15:56:12Z")

</div>

I believe you need to use `apis.google.com` in your CSP policy, not a fully qualified URL to the `platform.js` file which isn't what it's attempting to load.

```auto
csp.rules:
  - "script-src 'unsafe-inline' 'unsafe-eval' 'self' apis.google.com"

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 30, 2020, 3:56pm UTC](https://discuss.elastic.co/t/not-able-to-use-ts-react-google-login-component-node-package-in-plugin-for-authentication-in-7-8-oss-version/247131/3 "2020-09-30T15:56:13Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
