Skip to content

bug: core.GenerateSignInUri generates illegal url. #180

@wintbiit

Description

@wintbiit

Describe the bug

url generated by GenerateSignInUri at

func GenerateSignInUri(option *SignInUriGenerationOptions) (string, error) {
is illegal due to not url-escaped query values.

And unit test in core/sign_in_test.go is wrong as well since "https://example.com/authorize?client_id=clientId&code_challenge=codeChallenge&code_challenge_method=S256&prompt=login&redirect_uri=https://example.com/callback&resource=resourceA&resource=resourceB&response_type=code&scope=openid offline_access profile&state=state" is not a valid url (containing white space and browser link detection also shows).

Expected behavior

unit test TestGenerateSignInUriShouldGenerateCorrectUri should generate "https://example.com/authorize?client_id=clientId&code_challenge=codeChallenge&code_challenge_method=S256&prompt=login&redirect_uri=https%3A%2F%2Fexample.com%2Fcallback&resource=resourceA&resource=resourceB&response_type=code&scope=openid+offline_access+profile&state=state".

ref: https://docs.microfocus.com/OMi/10.62/Content/OMi/ExtGuide/ExtApps/URL_encoding.htm

How to reproduce?

go test ./core/

Environment

Self-hosted (Docker image)

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions