added user api

This commit is contained in:
2021-08-18 10:12:26 +05:30
parent e07d235b15
commit 994de2be5e
25 changed files with 49 additions and 46 deletions

View File

@ -11,6 +11,7 @@ import { CContainer, CFade } from '@coreui/react'
// routes config
import routes from '../routes'
import Sso from 'src/views/sso';
const loading = ( <
div className = "pt-3 text-center" >
@ -20,6 +21,11 @@ const loading = ( <
const TheContent = () => {
const sdata = { "expiration": 479, "client_address": "123.231.121.140", "protocol": "urn:oasis:names:tc:SAML:2.0:protocol", "identity_provider": "https://sso.ts.bizside.biz/idp/shibboleth", "authn_instant": "2021-08-16T11:29:41.254Z", "authncontext_class": "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport", "attributes": [ { "name": "mail", "values": [ "akira.miyata@mobilous.com" ] } ] }
useEffect(() => {
setSsoSession(sdata);
}, []);
const [SsoSession, setSsoSession] = useState('');
const [UserData, setUserData] = useState('');
@ -31,12 +37,14 @@ const TheContent = () => {
}
async function fetchUser() {
console.log(SsoSession.attributes[0].values[0])
const user_email = SsoSession.attributes[0].values[0]
console.log(user_email);
const company_code = "FBS";
const key = "api"
const pwd = "c558a56c63c44f65956adde8863ecc3558f3e55a465d4338bb2e7d2692866fd8";
console.log("making request");
// You can await here
const result = await axios.get('https://api.ts.bizside.biz/api/v7/' + company_code + '/users?email=' + user_email, {
auth: {
@ -50,7 +58,7 @@ const TheContent = () => {
function get_token_from_storage_or_cookie() {
localStorage.setItem('state', 'off');
//localStorage.setItem('state', 'off');
// const data = '{ "expiration": 479, "client_address": "123.231.121.140", "protocol": "urn:oasis:names:tc:SAML:2.0:protocol", "identity_provider": "https://sso.ts.bizside.biz/idp/shibboleth", "authn_instant": "2021-08-16T11:29:41.254Z", "authncontext_class": "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport", "attributes": [ { "name": "mail", "values": [ "akira.miyata@mobilous.com" ] } ] }'
// const jdata = JSON.parse(data);