# Single application can support both SPA and SAML?

**URL:** <https://devforum.okta.com/t/single-application-can-support-both-spa-and-saml/11213>\
**Category:** SAML\
**Tags:** saml\
**Created:** [October 6, 2020, 8:10pm UTC](https://devforum.okta.com/t/single-application-can-support-both-spa-and-saml/11213 "2020-10-06T20:10:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![VAMSI\_VEGESNA](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/vamsi_vegesna/32/2051_2.png) [@VAMSI\_VEGESNA](https://devforum.okta.com/u/VAMSI_VEGESNA)\
**Post date:** [October 6, 2020, 8:10pm UTC](https://devforum.okta.com/t/single-application-can-support-both-spa-and-saml/11213/1 "2020-10-06T20:10:52Z")

</div>

We created our applications as SPA(OIDC) in Okta and they are good so far. But recently there is a requirement to support SAML authentication as well for some new set of users. How can we support both these flows for our applications? Does Okta provide any specific way to do that?

Below is my understanding until now.

1. I need to create a new app for SAML authentication.
2. Create a web page before the login page asking for the end user’s email.
3. Validate the email through a lookup table and then direct the user to respective authentication flow(either SPA or SAML).

---

<div class="post-metadata">

**Author:** ![gpadma](https://avatars.discourse-cdn.com/v4/letter/g/858c86/32.png) [@gpadma](https://devforum.okta.com/u/gpadma)\
**Post date:** [October 6, 2020, 11:27pm UTC](https://devforum.okta.com/t/single-application-can-support-both-spa-and-saml/11213/2 "2020-10-06T23:27:55Z")

</div>

Hi @VAMSI_VEGESNA,

OIDC and SAML are two different standards for federated authentication. In Okta, you could create an application that follows OIDC (SPA/web app…) or an application of type SAML, you cannot create a single application that supports both these standards in Okta.

---

<div class="post-metadata">

**Author:** ![dragos](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/dragos/32/1313_2.png) [@dragos](https://devforum.okta.com/u/dragos)\
**Post date:** [October 7, 2020, 1:48am UTC](https://devforum.okta.com/t/single-application-can-support-both-spa-and-saml/11213/3 "2020-10-07T01:48:04Z")

</div>

Hi @VAMSI_VEGESNA

You would need to create an ACS endpoint inside your application which will receive the incoming SAMLResponse from Okta. Based on this SAMLResponse, you will need to create a session for the user inside the application. You can find more details about SAML [here](https://developer.okta.com/docs/concepts/saml/).

In short, this are the steps required to implement SAML inside your application:

- create a SAML application in Okta
- implement SAML in your application
  - Okta does not offer a proprietary SAML SDK, however you can use a third party SAML SDK specifically for the language in which the application was made

- configure the SAML SDK in your application with the values from Okta (issuer, public certificate, IDP SSO URL, etc.)
- implement a method in the application to validate the SAMLResponse coming from Okta using the SAML SDK and, after verification, create a session for the user

---

<div class="post-metadata">

**Author:** ![VAMSI\_VEGESNA](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/vamsi_vegesna/32/2051_2.png) [@VAMSI\_VEGESNA](https://devforum.okta.com/u/VAMSI_VEGESNA)\
**Post date:** [October 28, 2020, 4:15am UTC](https://devforum.okta.com/t/single-application-can-support-both-spa-and-saml/11213/4 "2020-10-28T04:15:59Z")

</div>

Thanks for the inputs. As per my understanding, irrespective of SAML or OIDC authentication Okta takes care of everything in the background and sends us the required tokens(access token and id token) and all for maintaining user sessions.

So I am thinking for both SPA and SAML I can have the same ACS code and flow using access tokens. My application is not required to be compatible with SAML. Am I correct?

---

<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:** [October 29, 2020, 12:53am UTC](https://devforum.okta.com/t/single-application-can-support-both-spa-and-saml/11213/5 "2020-10-29T00:53:51Z")

</div>

Yeah, it’s your choice which SSO mechanism to support. If you want to be fancy, then support both 🙂

---

<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:** [January 25, 2024, 1:04am UTC](https://devforum.okta.com/t/single-application-can-support-both-spa-and-saml/11213/6 "2024-01-25T01:04:35Z")

</div>

Closed on January 25, 2024, 1:04am UTC


