[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[reclaim-ui] 246/459: scopes in configuration
From: |
gnunet |
Subject: |
[reclaim-ui] 246/459: scopes in configuration |
Date: |
Fri, 11 Jun 2021 23:25:38 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository reclaim-ui.
commit b58d25dedadd13c8f23b56994e2c556905bcf648
Author: anna wimbauer <anna.wibauer@gmx.de>
AuthorDate: Mon Jul 20 09:22:56 2020 +0200
scopes in configuration
---
src/app/attestation.service.ts | 13 +++++++++++--
src/app/edit-attestations/edit-attestations.component.ts | 2 +-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/app/attestation.service.ts b/src/app/attestation.service.ts
index ed3d61f..e4acb79 100644
--- a/src/app/attestation.service.ts
+++ b/src/app/attestation.service.ts
@@ -3,6 +3,7 @@ import { Injectable } from '@angular/core'
import { Observable} from 'rxjs';
import { AuthConfig } from 'angular-oauth2-oidc';
import { IdProvider } from './idProvider';
+import { Scope } from './scope';
@Injectable()
export class AttestationService {
@@ -18,7 +19,7 @@ export class AttestationService {
return this.http.get<any>('https://' + email.split('@')[1] +
'/.well-known/webfinger?resource=acct:' + email);
}
- getOauthConfig(idProvider: IdProvider){
+ getOauthConfig(idProvider: IdProvider, scopes: Scope[]){
var redirectUri;
if (window.location.href.includes('localhost')){
const user = localStorage.getItem('userForAttestation');
@@ -28,6 +29,14 @@ export class AttestationService {
redirectUri = "https://ui.reclaim";
}
+ var scopeValues = '';
+ scopes.forEach(scope => {
+ if (scope.chosen){
+ scopeValues = scopeValues + ' ' + scope.scope;
+ }
+ });
+ console.log(scopeValues);
+
const authCodeFlowConfig: AuthConfig = {
// Url of the Identity Provider
issuer: idProvider.url,
@@ -55,7 +64,7 @@ export class AttestationService {
// The first four are defined by OIDC.
// Important: Request offline_access to get a refresh token
// The api scope is a usecase specific one
- scope: 'openid profile',
+ scope: scopeValues.slice(1),
showDebugInformation: true,
diff --git a/src/app/edit-attestations/edit-attestations.component.ts
b/src/app/edit-attestations/edit-attestations.component.ts
index caf5009..a139cf8 100644
--- a/src/app/edit-attestations/edit-attestations.component.ts
+++ b/src/app/edit-attestations/edit-attestations.component.ts
@@ -339,7 +339,7 @@ export class EditAttestationsComponent implements OnInit {
}
configureOauthService(){
- var authCodeFlowConfig =
this.attestationService.getOauthConfig(this.newIdProvider);
+ var authCodeFlowConfig =
this.attestationService.getOauthConfig(this.newIdProvider, this.scopes);
this.oauthService.configure(authCodeFlowConfig);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [reclaim-ui] 251/459: fix, (continued)
- [reclaim-ui] 251/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 259/459: fix attribute updates and display, gnunet, 2021/06/11
- [reclaim-ui] 243/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 257/459: minor wording change, gnunet, 2021/06/11
- [reclaim-ui] 248/459: minor info change, gnunet, 2021/06/11
- [reclaim-ui] 275/459: more info boxes, gnunet, 2021/06/11
- [reclaim-ui] 250/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 273/459: better requested claim handling, gnunet, 2021/06/11
- [reclaim-ui] 268/459: style, gnunet, 2021/06/11
- [reclaim-ui] 233/459: make discovery experimental, gnunet, 2021/06/11
- [reclaim-ui] 246/459: scopes in configuration,
gnunet <=
- [reclaim-ui] 254/459: fix array splicing, gnunet, 2021/06/11
- [reclaim-ui] 262/459: some cleanup, gnunet, 2021/06/11
- [reclaim-ui] 252/459: minor fix, gnunet, 2021/06/11
- [reclaim-ui] 260/459: fix flag settings, gnunet, 2021/06/11
- [reclaim-ui] 263/459: add spinner when saving, gnunet, 2021/06/11
- [reclaim-ui] 291/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 282/459: style change, gnunet, 2021/06/11
- [reclaim-ui] 265/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 287/459: add danger, gnunet, 2021/06/11
- [reclaim-ui] 241/459: formatting, gnunet, 2021/06/11