# Self Hosted Sign Widget PIV

**URL:** <https://devforum.okta.com/t/self-hosted-sign-widget-piv/11056>\
**Category:** Questions\
**Created:** [September 23, 2020, 9:03pm UTC](https://devforum.okta.com/t/self-hosted-sign-widget-piv/11056 "2020-09-23T21:03:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![danatgovini](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@danatgovini](https://devforum.okta.com/u/danatgovini)\
**Post date:** [September 23, 2020, 9:03pm UTC](https://devforum.okta.com/t/self-hosted-sign-widget-piv/11056/1 "2020-09-23T21:03:17Z")

</div>

Hello,

My organization uses the PIV/Smart Card feature in production now, it is hosted on Okta. We are trying to move to a self hosted sign on widget, and all the features work except the PIV.

When a PIV/CAC user clicks the PIV button the get a CORS exception in the console. We have enabled CORS/Redirect from the sign on url in the Trusted Origins section.

This is our PIV configuration for the `OktaSignIn`. The host in this example is something like `myorg.oktapreview.com`.

```auto
piv: {
        certAuthUrl: `https://${host}/login/cert`,
        text: 'Authenticate with a CAC Card',
        className: style.piv,
        isCustomDomain: false
},

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![phi1ipp](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@phi1ipp](https://devforum.okta.com/u/phi1ipp)\
**Post date:** [September 24, 2020, 8:36pm UTC](https://devforum.okta.com/t/self-hosted-sign-widget-piv/11056/2 "2020-09-24T20:36:47Z")

</div>

it should be

```auto
certAuthUrl: 'https://your_tenant_name.mtls.okta.com/api/internal/v1/authn/cert',

```

---

<div class="post-metadata">

**Author:** ![danatgovini](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@danatgovini](https://devforum.okta.com/u/danatgovini)\
**Post date:** [September 28, 2020, 5:49pm UTC](https://devforum.okta.com/t/self-hosted-sign-widget-piv/11056/3 "2020-09-28T17:49:36Z")

</div>

Thanks This endpoint was able to authenticate a CAC user. Is there anyway to redirect to a different audience.

Currently once a user authenticates they are redirected to the Okta home page. How would I redirect them back to an application like [https://mysubdomain.myorg.com/oauth2/idpresonse](https://mysubdomain.myorg.com/oauth2/idpresonse)?

---

<div class="post-metadata">

**Author:** ![phi1ipp](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@phi1ipp](https://devforum.okta.com/u/phi1ipp)\
**Post date:** [September 28, 2020, 6:11pm UTC](https://devforum.okta.com/t/self-hosted-sign-widget-piv/11056/4 "2020-09-28T18:11:08Z")

</div>

> [@danatgovini](#):
>
> Is there anyway to redirect to a different audience.

Please refer to a regular widget configuration. If you can configure a widget w/o PIV to redirect to a different URL, then PIV will work the same way, I assume

---

<div class="post-metadata">

**Author:** ![anthony.sessa](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/anthony.sessa/32/3319_2.png) [@anthony.sessa](https://devforum.okta.com/u/anthony.sessa)\
**Post date:** [September 10, 2021, 2:25pm UTC](https://devforum.okta.com/t/self-hosted-sign-widget-piv/11056/5 "2021-09-10T14:25:26Z")

</div>

@phi1ipp – I have dug and dug about how to do a correct redirect with PIV sign-in widget implementation to no avail

@danatgovini – were you able to figure this out?

Here is a link to topic I just posted.

> [@Sign in Widget PIV redirecting only to okta homepage](https://devforum.okta.com/t/sign-in-widget-piv-redirecting-only-to-okta-homepage/16052):
>
> Background info We are using PIV card IDP with the piv configuration options. We are able to successfully sign in using the PIV Card, but it always is redirecting to the /app/UserHome Expected behavior Should redirect back to web application ([http://localhost:3000/login/callback](http://localhost:3000/login/callback)) Steps to reproduce const widgetRef = useRef(); useEffect(() =\> { if (!widgetRef.current) { return false; } console.log(config.oidc.redirectUri); const { issuer, clientId, scopes } = config.oidc; con…

---

<div class="post-metadata">

**Author:** ![phi1ipp](https://avatars.discourse-cdn.com/v4/letter/p/85f322/32.png) [@phi1ipp](https://devforum.okta.com/u/phi1ipp)\
**Post date:** [September 10, 2021, 2:48pm UTC](https://devforum.okta.com/t/self-hosted-sign-widget-piv/11056/6 "2021-09-10T14:48:03Z")

</div>

@anthony.sessa, yeah I figured the same thing unfortunately. Maybe it’s worth opening a ticket on [https://github.com/okta/okta-signin-widget](https://github.com/okta/okta-signin-widget), if it doesn’t exist yet

---

<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:** [February 10, 2024, 12:57am UTC](https://devforum.okta.com/t/self-hosted-sign-widget-piv/11056/7 "2024-02-10T00:57:15Z")

</div>

Closed on February 10, 2024, 12:57am UTC

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