After OAUTH, SAML auth completion, Redirect to App custom url scheme with token data as query params. (#16447)

* Added redirection after Auth complete

* Fixed gofmt

* Handling error while parsing the url, added util function to check for a valid mobile redirect url

* Added check for custom scheme url validation

* Added test to verify custom schele url

* Added mobile message screens

* Translation strings for mobile screens

* Added mobile specific screens for success and error

* Added error logs and changed variable name for consistency with oauth.go

* i18n fix

* Reusing assigned variable instead of map

* Added AppCustomUrlScheme property

* Code refactor and removed dependency from cookies to build the final url

* Changed util function

* Updated util test

* Fixed go lint

* Code refactor and unsused code removed

* Code refactor

* simplified boolean checks

* Added support of whitelist of appCustomURLSchemes

* Changed i18 en

* Fixed validating redirecturl for web

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Anurag Shivarathri
2021-01-19 21:16:22 +05:30
коммит произвёл GitHub
родитель 911d1f070e
Коммит 3da6f270ec
7 изменённых файлов: 267 добавлений и 55 удалений

Просмотреть файл

@@ -160,3 +160,13 @@ func TestRemoveStringFromSlice(t *testing.T) {
assert.Equal(t, RemoveStringFromSlice("four", a), expected)
}
func TestAppendQueryParamsToURL(t *testing.T) {
url := "mattermost://callback"
redirectUrl := AppendQueryParamsToURL(url, map[string]string{
"key1": "value1",
"key2": "value2",
})
expected := url + "?key1=value1&key2=value2"
assert.Equal(t, redirectUrl, expected)
}