Commit 87a44aba authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg

Update fetch links with openid and regular userinfo endpoint

parent 206bbc6b
...@@ -56,12 +56,10 @@ class Component extends PureComponent { ...@@ -56,12 +56,10 @@ class Component extends PureComponent {
// console.log("PROPOS", this.props) // console.log("PROPOS", this.props)
if (this.props.serverConfig && this.props.serverConfig.authorization_endpoint && this.props.serverConfig.authorization_endpoint === 'https://auth.dataporten.no/oauth/authorization') { if (this.props.serverConfig && this.props.serverConfig.authorization_endpoint && this.props.serverConfig.authorization_endpoint === 'https://auth.dataporten.no/oauth/authorization') {
let links = [] let links = []
if (this.props.serverConfig.userinfo_endpoint) { links.push({
links.push({ url: "https://auth.dataporten.no/userinfo",
url: this.props.serverConfig.userinfo_endpoint, title: "Basic userinfo endpoint "
title: "Userinfo endpoint " })
})
}
const cntrl = /^gk_([^_]+)$/i const cntrl = /^gk_([^_]+)$/i
this.props.token.scopes.forEach((scope) => { this.props.token.scopes.forEach((scope) => {
if (scope === 'groups') { if (scope === 'groups') {
...@@ -70,6 +68,12 @@ class Component extends PureComponent { ...@@ -70,6 +68,12 @@ class Component extends PureComponent {
title: "Dataporten groups API: My groups" title: "Dataporten groups API: My groups"
}) })
} }
if (scope === 'openid' && this.props.serverConfig.userinfo_endpoint) {
links.push({
url: this.props.serverConfig.userinfo_endpoint,
title: "OpenID Userinfo endpoint "
})
}
let res = cntrl.exec(scope) let res = cntrl.exec(scope)
if (res) { if (res) {
links.push({ links.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment