Skip to content

Commit

Permalink
refactor:Add SCOPE
Browse files Browse the repository at this point in the history
Signed-off-by: Jerrico Dela Cruz <[email protected]>
  • Loading branch information
jerricotandelacruz committed Oct 25, 2024
1 parent 31393d8 commit e84d6f8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .bicep/webapp/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"TENANT_ID":"",
"CLIENT_ID":"",
"CLIENT_SECRET":"",
"SCOPE":"",

"NOTIFICATION_TENANT_ID":"",
"NOTIFICATION_CLIENT_ID":"",
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/setup-appservice-resource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
parameters.appServiceSettings.value.TENANT_ID : ${{ secrets.TENANT_ID }}
parameters.appServiceSettings.value.CLIENT_ID : ${{ secrets.CLIENT_ID }}
parameters.appServiceSettings.value.CLIENT_SECRET : ${{ secrets.CLIENT_SECRET }}
parameters.appServiceSettings.value.SCOPE : ${{ secrets.SCOPE }}
parameters.appServiceSettings.value.NOTIFICATION_TENANT_ID : ${{ secrets.NOTIFICATION_TENANT_ID }}
parameters.appServiceSettings.value.NOTIFICATION_CLIENT_ID : ${{ secrets.NOTIFICATION_CLIENT_ID }}
parameters.appServiceSettings.value.NOTIFICATION_CLIENT_SECRET : ${{ secrets.NOTIFICATION_CLIENT_SECRET }}
Expand Down
1 change: 1 addition & 0 deletions src/goapp/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PORT=<Port. Defaults to 8080>
TENANT_ID=<Tenant Id>
CLIENT_ID=<Client Id>
CLIENT_SECRET=<Client Secret>
SCOPE=<Scope>
NOTIFICATION_TENANT_ID=<Tenant Id>
NOTIFICATION_CLIENT_ID=<Client Id>
NOTIFICATION_CLIENT_SECRET=<Client Secret>
Expand Down
2 changes: 1 addition & 1 deletion src/goapp/pkg/authentication/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func GenerateToken() (string, error) {

data := url.Values{}
data.Set("client_id", os.Getenv("CLIENT_ID"))
data.Set("scope", "https://graph.microsoft.com/.default")
data.Set("scope", os.Getenv("SCOPE"))
data.Set("client_secret", os.Getenv("CLIENT_SECRET"))
data.Set("grant_type", "client_credentials")
encodedData := data.Encode()
Expand Down
2 changes: 1 addition & 1 deletion src/goapp/routes/api/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ func getHttpPostResponseStatus(url string, data interface{}, ch chan *http.Respo
req.Header.Add("Content-Type", "application/json")

client := &http.Client{
Timeout: time.Second * 10,
Timeout: time.Second * 60,
}

response, err := client.Do(req)
Expand Down

0 comments on commit e84d6f8

Please sign in to comment.