2022-02-24 03:28:53 +00:00
|
|
|
import { GetStaticProps } from 'next';
|
|
|
|
|
import Link from 'next/link';
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import config from '../lib/env';
|
|
|
|
|
import { IdPMetadata } from '../types';
|
2022-02-18 04:07:27 +00:00
|
|
|
|
2022-02-18 12:52:59 +00:00
|
|
|
export const getStaticProps: GetStaticProps = async () => {
|
2022-02-18 04:07:27 +00:00
|
|
|
const metadata: IdPMetadata = {
|
|
|
|
|
ssoUrl: config.ssoUrl,
|
|
|
|
|
entityId: config.entityId,
|
2022-03-02 21:06:04 +00:00
|
|
|
certificate: config.publicKey,
|
2022-02-18 08:56:42 +00:00
|
|
|
};
|
2022-02-18 04:07:27 +00:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
props: {
|
2022-02-18 08:56:42 +00:00
|
|
|
metadata,
|
2022-02-18 04:07:27 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2022-02-18 08:56:42 +00:00
|
|
|
const Home: React.FC<{ metadata: IdPMetadata }> = ({ metadata }) => {
|
2022-02-24 04:16:49 +00:00
|
|
|
const { ssoUrl, entityId, certificate } = metadata;
|
|
|
|
|
|
2022-01-08 15:11:13 +00:00
|
|
|
return (
|
2022-03-01 12:35:42 +00:00
|
|
|
<section className='body-font text-gray-600'>
|
|
|
|
|
<div className='container mx-auto px-5 py-24'>
|
|
|
|
|
<div className='mb-12 flex w-full flex-col text-center'>
|
|
|
|
|
<h1 className='title-font mb-4 text-2xl font-medium text-gray-900 sm:text-3xl'>
|
2022-02-24 04:16:49 +00:00
|
|
|
Mock SAML Metadata
|
|
|
|
|
</h1>
|
2022-02-28 05:52:49 +00:00
|
|
|
<p className='mx-auto text-lg font-medium leading-relaxed lg:w-2/3'>
|
2022-03-02 20:53:00 +00:00
|
|
|
A free SAML 2.0 Identity Provider for testing SAML SSO integrations.
|
2022-02-28 05:52:49 +00:00
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<b>Please do not use this in production.</b>
|
2022-02-24 04:16:49 +00:00
|
|
|
</p>
|
|
|
|
|
</div>
|
2022-03-01 12:35:42 +00:00
|
|
|
<div className='mx-auto flex w-full items-end space-y-4 px-8 sm:space-x-4 sm:space-y-0 sm:px-0 lg:w-2/3'>
|
2022-02-24 04:16:49 +00:00
|
|
|
<div className='relative mr-4 lg:w-full'>
|
|
|
|
|
<label className='text-sm leading-7 text-gray-600'>SSO URL</label>
|
2022-03-01 12:35:42 +00:00
|
|
|
<input readOnly type='text' defaultValue={ssoUrl} className='input w-full' />
|
2022-02-24 04:16:49 +00:00
|
|
|
</div>
|
|
|
|
|
<div className='relative mr-4 lg:w-full'>
|
|
|
|
|
<label className='text-sm leading-7 text-gray-600'>Entity ID</label>
|
2022-03-01 12:35:42 +00:00
|
|
|
<input readOnly type='text' defaultValue={entityId} className='input w-full' />
|
2022-02-24 04:16:49 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-03-01 12:35:42 +00:00
|
|
|
<div className='mx-auto mt-5 flex w-full items-end space-y-4 px-8 sm:space-x-4 sm:space-y-0 sm:px-0 lg:w-2/3'>
|
2022-02-24 04:16:49 +00:00
|
|
|
<div className='relative lg:w-full'>
|
|
|
|
|
<label className='text-sm leading-7 text-gray-600'>Certificate</label>
|
2022-03-01 12:35:42 +00:00
|
|
|
<textarea readOnly rows={5} defaultValue={certificate} className='input w-full'></textarea>
|
2022-02-24 04:16:49 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-03-01 12:35:42 +00:00
|
|
|
<div className='mx-auto mt-5 flex w-full items-end space-y-4 px-8 sm:space-x-4 sm:space-y-0 sm:px-0 lg:w-2/3'>
|
2022-02-24 04:16:49 +00:00
|
|
|
<Link href='/api/saml/metadata/download'>
|
2022-02-24 06:20:40 +00:00
|
|
|
<a className='button'>Download Metadata</a>
|
2022-02-24 04:16:49 +00:00
|
|
|
</Link>
|
|
|
|
|
</div>
|
2022-02-18 08:56:42 +00:00
|
|
|
</div>
|
2022-02-24 04:16:49 +00:00
|
|
|
</section>
|
2022-02-18 08:56:42 +00:00
|
|
|
);
|
|
|
|
|
};
|
2022-01-08 15:11:13 +00:00
|
|
|
|
2022-02-18 08:56:42 +00:00
|
|
|
export default Home;
|