Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
c33b246cf2 | |||
6d5b17515a | |||
9a6e8e25f2 | |||
9126817665 | |||
dccca37237 | |||
446999ac69 | |||
b1f6a4666c | |||
fdf1501152 | |||
774e302ce7 | |||
f5f3b38299 | |||
09dabc1c18 | |||
7b69a765e2 |
28
CHANGELOG.md
28
CHANGELOG.md
@ -1,3 +1,31 @@
|
|||||||
|
## [1.0.14](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/compare/v1.0.13...v1.0.14) (2024-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Add more extensive oauth scope ([9a6e8e2](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/commit/9a6e8e25f29d38dd3e66530d37445a5d5902db56))
|
||||||
|
|
||||||
|
## [1.0.13](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/compare/v1.0.12...v1.0.13) (2024-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Replace clientSecret value ([446999a](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/commit/446999ac69b38271c15a907beaad5f25b3363d5f))
|
||||||
|
|
||||||
|
## [1.0.12](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/compare/v1.0.11...v1.0.12) (2024-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Add callback debugging ([774e302](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/commit/774e302ce749f004e97650d05694162780e009d8))
|
||||||
|
|
||||||
|
## [1.0.11](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/compare/v1.0.10...v1.0.11) (2024-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Remove redundant slash character ([7b69a76](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/commit/7b69a765e2b8371a285999360721df81abee74c9))
|
||||||
|
|
||||||
## [1.0.10](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/compare/v1.0.9...v1.0.10) (2024-03-10)
|
## [1.0.10](http://gitea.gitea.svc.cluster.local:3000/djpbessems/ContainerImage.SpamasaurusRex/compare/v1.0.9...v1.0.10) (2024-03-10)
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,10 +20,10 @@ import (
|
|||||||
|
|
||||||
var config = oauth2.Config{
|
var config = oauth2.Config{
|
||||||
ClientID: "dccb4b93-3f75-4775-a94a-da39216d7daf",
|
ClientID: "dccb4b93-3f75-4775-a94a-da39216d7daf",
|
||||||
ClientSecret: "tiL8Q~qahoaZUck4ZG4sc5w.V_I.1c60bwkW6aYJ",
|
ClientSecret: "XN98Q~Wrp1RfakkihA1BaTKfokOSX9fuB01unanr",
|
||||||
Endpoint: microsoft.AzureADEndpoint("ceeae22e-f163-4ac9-b7c2-45972d3aed4f"),
|
Endpoint: microsoft.AzureADEndpoint("ceeae22e-f163-4ac9-b7c2-45972d3aed4f"),
|
||||||
RedirectURL: "https://alias.spamasaurus.com//callback",
|
RedirectURL: "https://alias.spamasaurus.com/callback",
|
||||||
Scopes: []string{"User.Read"},
|
Scopes: []string{"User.Read", "Profile"},
|
||||||
}
|
}
|
||||||
|
|
||||||
func rootHandler(w http.ResponseWriter, r *http.Request) {
|
func rootHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
@ -33,9 +33,11 @@ func rootHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
func callbackHandler(w http.ResponseWriter, r *http.Request) {
|
func callbackHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
// Handle the callback after successful authentication
|
// Handle the callback after successful authentication
|
||||||
code := r.URL.Query().Get("code")
|
token, err := config.Exchange(r.Context(), r.URL.Query().Get("code"))
|
||||||
token, err := config.Exchange(r.Context(), code)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if retrieveErr, ok := err.(*oauth2.RetrieveError); ok {
|
||||||
|
w.Write([]byte(retrieveErr.ErrorDescription + " (" + retrieveErr.ErrorCode + ")"))
|
||||||
|
}
|
||||||
http.Error(w, "Error exchanging code for token", http.StatusInternalServerError)
|
http.Error(w, "Error exchanging code for token", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user