# Getting AuthSdkError: No issuer passed to constructor. Required

**URL:** <https://devforum.okta.com/t/getting-authsdkerror-no-issuer-passed-to-constructor-required/12203>\
**Category:** Questions\
**Created:** [December 18, 2020, 2:12am UTC](https://devforum.okta.com/t/getting-authsdkerror-no-issuer-passed-to-constructor-required/12203 "2020-12-18T02:12:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeaverMatt](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@BeaverMatt](https://devforum.okta.com/u/BeaverMatt)\
**Post date:** [December 18, 2020, 2:12am UTC](https://devforum.okta.com/t/getting-authsdkerror-no-issuer-passed-to-constructor-required/12203/1 "2020-12-18T02:12:03Z")

</div>

![Screen Shot 2020-12-17 at 5.26.47 PM](https://global.discourse-cdn.com/oktadev/original/2X/0/05dd8386256cd5758e17a006365b217a6ae9a2c2.png)

I keep getting this error and I’m not sure what to do. I wrote the custom sign in in typescript and a bit lost.

Would anyone be able to point me in the right direction?

```
import React, { useState, useCallback } from 'react';
import { OktaAuth } from '@okta/okta-auth-js';
import { useOktaAuth } from '@okta/okta-react';
import { createUseStyles } from 'react-jss';
import Input from '../common/Input';
import Button from '../common/Button';
import LinkButton from '../common/LinkButton';
import FormBox from '../common/FormBox';
import { HOME } from '../../constants/routes';
import config from '../../utils/config'

const useStyles = createUseStyles({
    page: {
        width: '100%',
        height: '100%',
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'center',
        paddingTop: 100,
        paddingBottom: 200,
    },
    signUp: {
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'center',
    },
    link: {
        color: 'rgb(125, 0, 76)',
        marginLeft: 5,
        
    }
});

function SignIn({ issuer }:{[key:string]:any}) {
    const classes = useStyles();
    const { authService }:{[key:string]:any} = useOktaAuth();
    const [sessionToken, setSessionToken] = useState<string | undefined>('')
    const [email, setEmail] = useState<string | undefined>('');
    const [password, setPassword] = useState<string | undefined>('');

    const handleSubmit = (e:{[key:string]:any}) => {
        e.preventDefault();
        const oktaAuth = new OktaAuth({
          // If your app is configured to use the Implicit Flow
          // instead of the Authorization Code with Proof of Code Key Exchange (PKCE)
          // you will need to uncomment the below line:
          // pkce: false,
          issuer: issuer
          });
        oktaAuth.signIn({ email, password })
        .then(res => {
          const sessionToken = res.sessionToken;
          setSessionToken(sessionToken);
          // sessionToken is a one-use token, so make sure this is only called once
          authService.redirect({ sessionToken });
        })
        .catch(err => console.log('Found an error', err));
      };
    
      const handleEmailChange = (e:{[key:string]:any}) => {
        setEmail(e.target.value);
      };
    
      const handlePasswordChange = (e:{[key:string]:any}) => {
        setPassword(e.target.value);
      };
    
      if (sessionToken) {
        // Hide form while sessionToken is converted into id/access tokens
        return null;
     }

    return (
    <div className={classes.page}>
       <FormBox title="Sign In" onSubmit={handleSubmit}>
            <Input 
                type="email"
                placeholder="Email address" 
                value={email}
                onChange={(value?: string) => setEmail(value)} required/>
            <Input 
                type="password" 
                placeholder="Password" 
                value={password}
                minLength={5}
                onChange={(value?: string) => setPassword(value)} required/>
            <LinkButton text="Forgot Password?" to={HOME} bold/>
            <Button text="Log In" onClick={() => {}} />
            <div className={classes.signUp}>
            <p>Not a member?</p> 
            <a href="/signup" className={classes.link}>Sign up</a>
            </div>
          
      </FormBox>
      
   </div>
  
    );
}

export default SignIn;
```

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [December 22, 2020, 5:16pm UTC](https://devforum.okta.com/t/getting-authsdkerror-no-issuer-passed-to-constructor-required/12203/2 "2020-12-22T17:16:54Z")

</div>

Are you providing a value for “issuer”?

[The error you are seeing](https://github.com/okta/okta-auth-js/blob/1b219e97822dd32ec9d26955f171fc4d1f6a5c96/lib/builderUtil.ts#L21-L25) seems to imply that this value has not been set in your config. Depending on your use case, the issuer should either be your Okta org domain, [https://org.okta.com](https://org.okta.com) (or a custom URL domain), or a custom authorization server, such as [https://org.okta.com/oauth2/default](https://org.okta.com/oauth2/default).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [December 29, 2020, 5:40pm UTC](https://devforum.okta.com/t/getting-authsdkerror-no-issuer-passed-to-constructor-required/12203/3 "2020-12-29T17:40:47Z")

</div>

Closed on December 29, 2020, 5:40pm UTC

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