Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
atdb-ldv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON SDC
atdb-ldv
Commits
605dea07
Commit
605dea07
authored
2 years ago
by
Nico Vermaas
Browse files
Options
Downloads
Patches
Plain Diff
troubleshooting keycloak
parent
3442f641
No related branches found
Branches containing commit
No related tags found
1 merge request
!279
Master
Pipeline
#43780
passed
2 years ago
Stage: build
Stage: deploy_to_test
Stage: deploy_to_production
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
atdb/atdb/settings/base.py
+8
-4
8 additions, 4 deletions
atdb/atdb/settings/base.py
atdb/atdb/settings/dev.py
+7
-0
7 additions, 0 deletions
atdb/atdb/settings/dev.py
atdb/taskdatabase/services/signals.py
+2
-2
2 additions, 2 deletions
atdb/taskdatabase/services/signals.py
with
17 additions
and
6 deletions
atdb/atdb/settings/base.py
+
8
−
4
View file @
605dea07
import
os
import
os
import
logging
logger
=
logging
.
getLogger
(
__name__
)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
...
@@ -225,7 +227,7 @@ AUTHENTICATION_BACKENDS = [
...
@@ -225,7 +227,7 @@ AUTHENTICATION_BACKENDS = [
try
:
try
:
KEYCLOAK_URL
=
os
.
environ
[
'
KEYCLOAK_URL
'
]
KEYCLOAK_URL
=
os
.
environ
[
'
KEYCLOAK_URL
'
]
except
:
except
:
KEYCLOAK_URL
=
'
https://
sdc-dev
.astron.nl/auth
'
KEYCLOAK_URL
=
'
https://
keycloak
.astron.nl/auth
'
SOCIALACCOUNT_PROVIDERS
=
{
SOCIALACCOUNT_PROVIDERS
=
{
'
keycloak
'
:
{
'
keycloak
'
:
{
...
@@ -238,9 +240,11 @@ SOCIALACCOUNT_PROVIDERS = {
...
@@ -238,9 +240,11 @@ SOCIALACCOUNT_PROVIDERS = {
try
:
try
:
LOGIN_REDIRECT_URL
=
os
.
environ
[
'
LOGIN_REDIRECT_URL
'
]
LOGIN_REDIRECT_URL
=
os
.
environ
[
'
LOGIN_REDIRECT_URL
'
]
except
:
except
:
LOGIN_REDIRECT_URL
=
'
https://sdc-dev.astron.nl:5554/atdb/
'
LOGIN_REDIRECT_URL
=
'
https://sdc.astron.nl:5554/atdb/
'
logger
.
info
(
"
LOGIN_REDIRECT_URL:
"
+
LOGIN_REDIRECT_URL
)
logger
.
info
(
"
KEYCLOAK_URL:
"
+
KEYCLOAK_URL
)
print
(
"
LOGIN_REDIRECT_URL:
"
,
LOGIN_REDIRECT_URL
)
print
(
"
KEYCLOAK_URL:
"
,
KEYCLOAK_URL
)
SESSION_COOKIE_NAME
=
'
my_service_name_session_id
'
SESSION_COOKIE_NAME
=
'
my_service_name_session_id
'
CSRF_COOKIE_NAME
=
'
my_service_csrftoken
'
CSRF_COOKIE_NAME
=
'
my_service_csrftoken
'
This diff is collapsed.
Click to expand it.
atdb/atdb/settings/dev.py
+
7
−
0
View file @
605dea07
...
@@ -25,3 +25,10 @@ DATABASES = {
...
@@ -25,3 +25,10 @@ DATABASES = {
AUTH_PASSWORD_VALIDATORS
=
[]
AUTH_PASSWORD_VALIDATORS
=
[]
LOGIN_REDIRECT_URL
=
"
http://localhost:8000/atdb
"
LOGIN_REDIRECT_URL
=
"
http://localhost:8000/atdb
"
SOCIALACCOUNT_PROVIDERS
=
{
'
keycloak
'
:
{
'
KEYCLOAK_URL
'
:
'
https://sdc-dev.astron.nl/auth
'
,
'
KEYCLOAK_REALM
'
:
'
SDC
'
,
'
SCOPE
'
:
[
'
openid
'
,
'
profile
'
,
'
email
'
]
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
atdb/taskdatabase/services/signals.py
+
2
−
2
View file @
605dea07
...
@@ -18,7 +18,7 @@ logger = logging.getLogger(__name__)
...
@@ -18,7 +18,7 @@ logger = logging.getLogger(__name__)
@receiver
(
pre_save
,
sender
=
Task
)
@receiver
(
pre_save
,
sender
=
Task
)
def
pre_save_task_handler
(
sender
,
**
kwargs
):
def
pre_save_task_handler
(
sender
,
**
kwargs
):
logger
.
info
(
"
SIGNAL : pre_save Task(
"
+
str
(
kwargs
.
get
(
'
instance
'
))
+
"
)
"
)
#
logger.info("SIGNAL : pre_save Task(" + str(kwargs.get('instance')) + ")")
handle_pre_save
(
sender
,
**
kwargs
)
handle_pre_save
(
sender
,
**
kwargs
)
def
handle_pre_save
(
sender
,
**
kwargs
):
def
handle_pre_save
(
sender
,
**
kwargs
):
...
@@ -27,7 +27,7 @@ def handle_pre_save(sender, **kwargs):
...
@@ -27,7 +27,7 @@ def handle_pre_save(sender, **kwargs):
:param (in) sender: The model class that sends the trigger
:param (in) sender: The model class that sends the trigger
:param (in) kwargs: The instance of the object that sends the trigger.
:param (in) kwargs: The instance of the object that sends the trigger.
"""
"""
logger
.
info
(
"
handle_pre_save(
"
+
str
(
kwargs
.
get
(
'
instance
'
))
+
"
)
"
)
#
logger.info("handle_pre_save(" + str(kwargs.get('instance')) + ")")
myTaskObject
=
kwargs
.
get
(
'
instance
'
)
myTaskObject
=
kwargs
.
get
(
'
instance
'
)
# IF this object does not exist yet, then abort, and let it first be handled by handle_post_save (get get a id).
# IF this object does not exist yet, then abort, and let it first be handled by handle_post_save (get get a id).
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment