77 lines
2.2 KiB
Vue
77 lines
2.2 KiB
Vue
<template>
|
|
<div class="container">
|
|
<h1>KTU SA Problemų sprendimo sistema</h1>
|
|
|
|
<template v-if="$store.state.msalAuth.isLoggedIn">
|
|
<div class="alert alert-success">
|
|
<h4 class="alert-heading">Tu esi prisijungęs</h4>
|
|
<span>
|
|
Kliento aplikacija turi tavo saugos raktą. Aplikacija žino, kad tavo
|
|
el. paštas yra: <b>{{ $store.state.msalAuth.email }}</b>
|
|
</span>
|
|
</div>
|
|
<h3>Priegos raktas (Access token)</h3>
|
|
<a
|
|
href="https://docs.microsoft.com/en-us/azure/active-directory/develop/access-tokens"
|
|
>Dokumentacija</a
|
|
>
|
|
<pre>{{ $store.state.msalAuth.accessToken }}</pre>
|
|
|
|
<h3>Indentifikacijos raktas (ID Token)</h3>
|
|
<a
|
|
href="https://docs.microsoft.com/en-us/azure/active-directory/develop/id-tokens"
|
|
>Dokumentacija</a
|
|
>
|
|
<pre>{{ $store.state.msalAuth.idToken }}</pre>
|
|
|
|
<h4>Duomenys gaunami iš Indentifikacijos rakto (ID Token)</h4>
|
|
<pre>{{
|
|
$store.state.msalAuth.debugFullTokenResponse.idTokenClaims
|
|
}}</pre>
|
|
<h3>Autorizuotos sritys</h3>
|
|
<pre>{{ $store.state.msalAuth.debugFullTokenResponse.scopes }}</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>
|
|
|
|
<script>
|
|
import axios from 'axios'
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
verificationResult: null,
|
|
}
|
|
},
|
|
methods: {
|
|
serverVerify() {
|
|
this.verificationResult = null
|
|
axios
|
|
.get('/api/AuthMetadata/authed', {
|
|
headers: {
|
|
Authorization: `Bearer ${this.$store.state.msalAuth.idToken}`,
|
|
},
|
|
})
|
|
.then(response => {
|
|
this.verificationResult = response.data
|
|
})
|
|
.catch(function(error) {
|
|
alert(error)
|
|
})
|
|
},
|
|
},
|
|
}
|
|
</script>
|