-
-
Create Next App
-
-
-
-
-
-
-
-
- Get started by editing{' '}
- pages/index.tsx
-
-
-
-
-
-
+
+
Mock IdP Metadata
+
SSO URL: {metadata.ssoUrl}
+
Entity ID: {metadata.entityId}
+
Certificate: {metadata.certificate}
+
+
Download Metadata
)
}
diff --git a/pages/saml2/apps/[appid].tsx b/pages/saml/index.tsx
similarity index 56%
rename from pages/saml2/apps/[appid].tsx
rename to pages/saml/index.tsx
index 011406c..39d263c 100644
--- a/pages/saml2/apps/[appid].tsx
+++ b/pages/saml/index.tsx
@@ -1,11 +1,11 @@
import type { GetServerSideProps } from 'next';
import React from "react";
-import { AuthNRequest } from '../../../types'
-import {extractSAMLRequestAttributes} from '../../../utils'
+import { AuthNRequest } from '../../types'
+import { extractSAMLRequestAttributes } from '../../utils'
export const getServerSideProps: GetServerSideProps = async ({query, params}) => {
const relayState = query.RelayState as string;
- const samlRequest = query.SAMLRequest as string;
+ const samlRequest = query.SAMLRequest as string;
const attributes = await extractSAMLRequestAttributes(samlRequest);
@@ -20,19 +20,9 @@ export const getServerSideProps: GetServerSideProps = async ({query, params}) =>
}
const ProcessRequest: React.FC
= ({relayState, samlRequest}) => {
-
-
return (
Process Request
);
}
-export default ProcessRequest;
-
-// Start a session
-// Store the RelayState in the session
-// Parse the SAMLRequest
-// Validate the SAMLRequest
-// Create SAMLResponse
-// POST the SAMLResponse to ACS URL
-// Remove the RelayState from the session
\ No newline at end of file
+export default ProcessRequest;
\ No newline at end of file
diff --git a/pages/saml/sso.tsx b/pages/saml/sso.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/types/index.ts b/types/index.ts
index 98ddc3d..9a7acd8 100644
--- a/types/index.ts
+++ b/types/index.ts
@@ -4,8 +4,8 @@ export type ServiceProvider = {
};
export type IdentityProvider = {
- sso_url: string;
- entity_id: string;
+ ssoUrl: string;
+ entityId: string;
};
export type App = {
diff --git a/utils/index.ts b/utils/index.ts
index bb8d93b..26dc92c 100644
--- a/utils/index.ts
+++ b/utils/index.ts
@@ -76,10 +76,6 @@ const createSAMLResponseXML = async (user: User): Promise => {
.replace('user_lastName', 'K');
};
-const createIdPSSOUrl = (appId: string) => {
- return `${config.appUrl}/saml2/apps/${appId}`;
-}
-
export {
parseXML,
extractSAMLRequestAttributes,
@@ -87,5 +83,4 @@ export {
createSAMLResponseXML,
createCertificate,
extractCert,
- createIdPSSOUrl,
};
\ No newline at end of file