Legal info
This commit is contained in:
1309
KTUSA PS/ClientApp/package-lock.json
generated
1309
KTUSA PS/ClientApp/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,8 +9,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.20.0-0",
|
"axios": "^0.20.0-0",
|
||||||
"balm-ui": "^8.44.0",
|
"bootstrap": "^5.1.1",
|
||||||
"bootstrap": "^4.5.3",
|
|
||||||
"cookies-js": "^1.2.3",
|
"cookies-js": "^1.2.3",
|
||||||
"core-js": "^3.7.0",
|
"core-js": "^3.7.0",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
@@ -26,7 +25,9 @@
|
|||||||
"@vue/compiler-sfc": "^3.0.2",
|
"@vue/compiler-sfc": "^3.0.2",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^6.8.0",
|
||||||
"eslint-plugin-vue": "^7.1.0"
|
"eslint-plugin-vue": "^7.1.0",
|
||||||
|
"sass": "^1.33.0",
|
||||||
|
"sass-loader": "^10.2.0"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"root": true,
|
"root": true,
|
||||||
|
@@ -18,12 +18,4 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#app {
|
|
||||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
text-align: center;
|
|
||||||
color: #2c3e50;
|
|
||||||
margin-top: 60px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
1
KTUSA PS/ClientApp/src/assets/_custom.scss
Normal file
1
KTUSA PS/ClientApp/src/assets/_custom.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
2
KTUSA PS/ClientApp/src/assets/main.scss
Normal file
2
KTUSA PS/ClientApp/src/assets/main.scss
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
@import "custom";
|
||||||
|
@import "~bootstrap/scss/bootstrap";
|
@@ -1,8 +1,8 @@
|
|||||||
import "bootstrap/dist/css/bootstrap.css";
|
|
||||||
import { createApp } from "vue";
|
import { createApp } from "vue";
|
||||||
import App from "./App.vue";
|
import App from "./App.vue";
|
||||||
import router from "./router";
|
import router from "./router";
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
|
import "./assets/main.scss";
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
||||||
|
@@ -1,12 +1,97 @@
|
|||||||
<template>
|
<template>
|
||||||
<h1>Hello there</h1>
|
<div class="container">
|
||||||
<!-- {{ $store.state.auth.tokenData }} -->
|
<h1>KTU SA Problemų sprendimo sistema</h1>
|
||||||
{{ $store.getters["auth/isValid"] }}
|
|
||||||
<br />
|
<template v-if="$store.getters['auth/isValid']">
|
||||||
Your name is: {{ $store.getters["auth/name"] }}<br />
|
<div class="alert alert-success">
|
||||||
Your email is: {{ $store.getters["auth/email"] }}<br />
|
<h4 class="alert-heading">Tu esi prisijungęs</h4>
|
||||||
|
<p>Kliento aplikacija turi tavo saugos raktą. aplikacija žino, kad tavo el. paštas yra: <b>{{ $store.getters["auth/email"] }}</b></p>
|
||||||
|
</div>
|
||||||
|
<h2>Visi laukai gaunami iš Azure Active Directory</h2>
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Pavadinimas</th>
|
||||||
|
<th scope="col">Reikšmė</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="(value, key) in authDataTable" :key="key">
|
||||||
|
<td>{{ key }}</td>
|
||||||
|
<td>{{ value }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Techninė duomenų reprezentacija</h3>
|
||||||
|
<a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/access-tokens">Dokumentacija apie laukų reikšmes</a>
|
||||||
|
<pre>{{ $store.state.auth.tokenData }}</pre>
|
||||||
|
<h3>Saugos raktas.</h3>
|
||||||
|
<pre>{{ $store.state.auth.token }}</pre>
|
||||||
|
<h3>Serverio tokeno patikrinimas</h3>
|
||||||
|
<button type="button" class="btn btn-primary" @click="serverVerify">Patikrinti</button>
|
||||||
|
<h5>Verifikacijos atsakas:</h5>
|
||||||
|
<pre>
|
||||||
|
{{ verificationResult }}
|
||||||
|
</pre>
|
||||||
|
</template>
|
||||||
|
<div v-else class="alert alert-danger" role="alert">
|
||||||
|
<h4 class="alert-heading">Tu neprisijungęs</h4>
|
||||||
|
<p>Prašom paspausti prisijungimo mygtuką navigacijos juostoje.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {};
|
import axios from "axios";
|
||||||
|
|
||||||
|
const names = {
|
||||||
|
"aud": "AppId (Audience)",
|
||||||
|
"iss": "Išdavėjas",
|
||||||
|
"iat": "Išdavimo momentas",
|
||||||
|
"nbf": "Negalioja anksčiau nei",
|
||||||
|
"exp": "Galiojimo pabaiga",
|
||||||
|
"email": "El. paštas",
|
||||||
|
"nonce": "Aplikacijos sugeneruota nepasikartojanti reikšmė",
|
||||||
|
"sub": "Subjektas (Vartotojo Id)",
|
||||||
|
"tid": "Tenanto Identifikatorius",
|
||||||
|
"ver": "OAuth versija"
|
||||||
|
}
|
||||||
|
|
||||||
|
function lookupName(key) {
|
||||||
|
if(names[key])
|
||||||
|
return names[key];
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
verificationResult: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
authDataTable() {
|
||||||
|
return Object.fromEntries(Object.entries(this.$store.state.auth.tokenData).map(([key, value]) => [lookupName(key), value]))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
serverVerify() {
|
||||||
|
this.verificationResult = null
|
||||||
|
axios
|
||||||
|
.get("/test/authed", {
|
||||||
|
headers: { Authorization: `Bearer ${this.$store.state.auth.token}` },
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.verificationResult = response.data;
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
alert(error);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
@@ -25,14 +25,14 @@ const getters = {
|
|||||||
if (now > exp) return false;
|
if (now > exp) return false;
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
name(state, getters) {
|
|
||||||
if (!getters.isValid) return null;
|
|
||||||
return state.tokenData.name;
|
|
||||||
},
|
|
||||||
email(state, getters) {
|
email(state, getters) {
|
||||||
if (!getters.isValid) return null;
|
if (!getters.isValid) return null;
|
||||||
return state.tokenData.email;
|
return state.tokenData.email;
|
||||||
},
|
},
|
||||||
|
userId(state, getters) {
|
||||||
|
if (!getters.isValid) return null;
|
||||||
|
return state.tokenData.email;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// actions
|
// actions
|
||||||
|
@@ -19,5 +19,8 @@ namespace KTUSA_PS.Controllers
|
|||||||
{
|
{
|
||||||
return this.HttpContext.User.Claims.Select(x => new { Name = x.Type, Value= x.Value }).ToArray();
|
return this.HttpContext.User.Claims.Select(x => new { Name = x.Type, Value= x.Value }).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet("authed")]
|
||||||
|
public bool IsAuthed() => true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,6 +22,10 @@
|
|||||||
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
|
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="ClientApp\src\assets\NewFile.txt" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
|
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
|
||||||
<!-- Ensure Node.js is installed -->
|
<!-- Ensure Node.js is installed -->
|
||||||
<Exec Command="node --version" ContinueOnError="true">
|
<Exec Command="node --version" ContinueOnError="true">
|
||||||
|
Reference in New Issue
Block a user