gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]