Skip to content

Commit

Permalink
Fix registration (#1006)
Browse files Browse the repository at this point in the history
* tentatively set redirect uri to be home for registration

* seems to work now

* use %20 to replace space

* revert realm.json

* fix deployment

* revert clowder realm

* revert
  • Loading branch information
longshuicy authored Apr 25, 2024
1 parent 3db8140 commit 1eaf79e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion backend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Settings(BaseSettings):
# scope=openid email&redirect_uri=http://<domain.com>/<redirect-path>&kc_locale=<two-digit-lang-code>
auth_register_url = (
f"{auth_base}/keycloak/realms/{auth_realm}/protocol/openid-connect/registrations?client_id"
f"={auth_client_id}&response_type=code&redirect_uri={auth_redirect_uri}"
f"={auth_client_id}&response_type=code"
)
auth_token_url = (
f"{auth_base}/keycloak/realms/{auth_realm}/protocol/openid-connect/token"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
- name: oauth2_scheme_auth_url
value: http://{{ include "clowder2.name" .}}-keycloak-headless:8080/keycloak/realms/clowder/protocol/openid-connect/auth?client_id=clowder2-backend&response_type=code
- name: auth_register_url
value: $(CLOWDER2_URL)/keycloak/realms/clowder/protocol/openid-connect/registrations?client_id=clowder2-backend&response_type=code&redirect_uri=$(auth_redirect_uri)
value: $(CLOWDER2_URL)/keycloak/realms/clowder/protocol/openid-connect/registrations?client_id=clowder2-backend&response_type=code&redirect_uri=$(auth_redirect_uri)&scope=openid%20email
- name: auth_token_url
value: http://{{ include "clowder2.name" .}}-keycloak-headless:8080/keycloak/realms/clowder/protocol/openid-connect/token
- name: auth_server_url
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ services:
auth_redirect_uri: http://localhost:80/api/v2/auth
auth_url: http://localhost/keycloak/realms/clowder/protocol/openid-connect/auth?client_id=clowder2-backend&response_type=code
oauth2_scheme_auth_url: http://keycloak:8080/keycloak/realms/clowder/protocol/openid-connect/auth?client_id=clowder2-backend&response_type=code
auth_register_url: http://localhost/keycloak/realms/clowder/protocol/openid-connect/registrations?client_id=clowder2-backend&response_type=code
auth_register_url: http://localhost/keycloak/realms/clowder/protocol/openid-connect/registrations?client_id=clowder2-backend&response_type=code&redirect_uri=http://localhost:80/api/v2/auth&scope=openid%20email
auth_token_url: http://keycloak:8080/keycloak/realms/clowder/protocol/openid-connect/token
auth_server_url: http://keycloak:8080/keycloak/
keycloak_base: http://localhost/api
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ services:
auth_redirect_uri: http://localhost:80/api/v2/auth
auth_url: http://localhost/keycloak/realms/clowder/protocol/openid-connect/auth?client_id=clowder2-backend&response_type=code
oauth2_scheme_auth_url: http://keycloak:8080/keycloak/realms/clowder/protocol/openid-connect/auth?client_id=clowder2-backend&response_type=code
auth_register_url: http://localhost/keycloak/realms/clowder/protocol/openid-connect/registrations?client_id=clowder2-backend&response_type=code&redirect_uri=http://localhost:80/api/v2/auth
auth_register_url: http://localhost/keycloak/realms/clowder/protocol/openid-connect/registrations?client_id=clowder2-backend&response_type=code&redirect_uri=http://localhost:80/api/v2/auth&scope=openid%20email
auth_token_url: http://keycloak:8080/keycloak/realms/clowder/protocol/openid-connect/token
auth_server_url: http://keycloak:8080/keycloak/
keycloak_base: http://localhost/api
Expand Down Expand Up @@ -191,7 +191,7 @@ services:
POSTGRES_PASSWORD: password

keycloak:
image: quay.io/keycloak/keycloak:19.0
image: quay.io/keycloak/keycloak:20.0
restart: unless-stopped
networks:
- clowder2
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ export default function PersistentDrawerLeft(props) {
<Box sx={{ marginLeft: "auto" }}>
{loggedOut ? (
<>
{/*<Link href="/auth/register" sx={link}>*/}
{/* Register*/}
{/*</Link>*/}
<Link href="/auth/register" sx={link}>
Register
</Link>
<Link href="/auth/login" sx={link}>
Login
</Link>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/PublicLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ export default function PersistentDrawerLeft(props) {
</SearchDiv>
<Box sx={{ flexGrow: 1 }} />
<Box sx={{ marginLeft: "auto" }}>
{/*<Link href="/auth/register" sx={link}>*/}
{/* Register*/}
{/*</Link>*/}
<Link href="/auth/register" sx={link}>
Register
</Link>
<Link href="/auth/login" sx={link}>
Login
</Link>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/navigation/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export default function TopBar() {
</Box>
{loggedOut ? (
<>
{/*<Link href="/auth/register" sx={link}>*/}
{/* Register*/}
{/*</Link>*/}
<Link href="/auth/register" sx={link}>
Register
</Link>
<Link href="/auth/login" sx={link}>
Login
</Link>
Expand Down

0 comments on commit 1eaf79e

Please sign in to comment.