Some stuff

This commit is contained in:
Karolis2011
2021-12-22 22:50:09 +02:00
parent 997154efa8
commit cad4268b79
11 changed files with 236 additions and 36 deletions

View File

@@ -10,34 +10,46 @@
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>
<template v-if="$store.state.msalAuth.isAdmin">
<div class="alert alert-warning">
<span>
Tu esi administratorius.
</span>
</div>
<h3>Prieigos 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>
<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 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>
<h4>Duomenys gaunami 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>
<button
type="button"
class="btn btn-primary"
@click="serverAdminVerify"
>
Patikrinti ar admin
</button>
<h5>Verifikacijos atsakas:</h5>
<pre>{{ verificationResult }}</pre>
</template>
</template>
<div v-else class="alert alert-danger" role="alert">
<h4 class="alert-heading">Tu neprisijungęs</h4>
@@ -71,6 +83,21 @@ export default {
alert(error)
})
},
serverAdminVerify() {
this.verificationResult = null
axios
.get('/api/AuthMetadata/Admin', {
headers: {
Authorization: `Bearer ${this.$store.state.msalAuth.idToken}`,
},
})
.then(response => {
this.verificationResult = response.data
})
.catch(function(error) {
alert(error)
})
},
},
}
</script>