authentik.sources.scim.views.v2.service_provider_config
SCIM Meta views
1"""SCIM Meta views""" 2 3from django.conf import settings 4from rest_framework.request import Request 5from rest_framework.response import Response 6 7from authentik.admin.utils import get_system_settings 8from authentik.sources.scim.views.v2.base import SCIMView 9 10 11class ServiceProviderConfigView(SCIMView): 12 """ServiceProviderConfig, https://ldapwiki.com/wiki/SCIM%20ServiceProviderConfig%20endpoint""" 13 14 # pylint: disable=unused-argument 15 def get(self, request: Request, source_slug: str) -> Response: 16 """Get ServiceProviderConfig""" 17 auth_schemas = [ 18 { 19 "type": "oauthbearertoken", 20 "name": "OAuth Bearer Token", 21 "description": "Authentication scheme using the OAuth Bearer Token Standard", 22 "primary": True, 23 }, 24 ] 25 if settings.TEST or settings.DEBUG: 26 auth_schemas.append( 27 { 28 "type": "httpbasic", 29 "name": "HTTP Basic", 30 "description": "Authentication scheme using HTTP Basic authorization", 31 }, 32 ) 33 return Response( 34 { 35 "schemas": ["urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"], 36 "authenticationSchemes": auth_schemas, 37 "patch": {"supported": True}, 38 "bulk": {"supported": False, "maxOperations": 0, "maxPayloadSize": 0}, 39 "filter": { 40 "supported": True, 41 "maxResults": get_system_settings().pagination_default_page_size, 42 }, 43 "changePassword": {"supported": False}, 44 "sort": {"supported": False}, 45 "etag": {"supported": False}, 46 } 47 )
12class ServiceProviderConfigView(SCIMView): 13 """ServiceProviderConfig, https://ldapwiki.com/wiki/SCIM%20ServiceProviderConfig%20endpoint""" 14 15 # pylint: disable=unused-argument 16 def get(self, request: Request, source_slug: str) -> Response: 17 """Get ServiceProviderConfig""" 18 auth_schemas = [ 19 { 20 "type": "oauthbearertoken", 21 "name": "OAuth Bearer Token", 22 "description": "Authentication scheme using the OAuth Bearer Token Standard", 23 "primary": True, 24 }, 25 ] 26 if settings.TEST or settings.DEBUG: 27 auth_schemas.append( 28 { 29 "type": "httpbasic", 30 "name": "HTTP Basic", 31 "description": "Authentication scheme using HTTP Basic authorization", 32 }, 33 ) 34 return Response( 35 { 36 "schemas": ["urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"], 37 "authenticationSchemes": auth_schemas, 38 "patch": {"supported": True}, 39 "bulk": {"supported": False, "maxOperations": 0, "maxPayloadSize": 0}, 40 "filter": { 41 "supported": True, 42 "maxResults": get_system_settings().pagination_default_page_size, 43 }, 44 "changePassword": {"supported": False}, 45 "sort": {"supported": False}, 46 "etag": {"supported": False}, 47 } 48 )
ServiceProviderConfig, https://ldapwiki.com/wiki/SCIM%20ServiceProviderConfig%20endpoint
def
get( self, request: rest_framework.request.Request, source_slug: str) -> rest_framework.response.Response:
16 def get(self, request: Request, source_slug: str) -> Response: 17 """Get ServiceProviderConfig""" 18 auth_schemas = [ 19 { 20 "type": "oauthbearertoken", 21 "name": "OAuth Bearer Token", 22 "description": "Authentication scheme using the OAuth Bearer Token Standard", 23 "primary": True, 24 }, 25 ] 26 if settings.TEST or settings.DEBUG: 27 auth_schemas.append( 28 { 29 "type": "httpbasic", 30 "name": "HTTP Basic", 31 "description": "Authentication scheme using HTTP Basic authorization", 32 }, 33 ) 34 return Response( 35 { 36 "schemas": ["urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"], 37 "authenticationSchemes": auth_schemas, 38 "patch": {"supported": True}, 39 "bulk": {"supported": False, "maxOperations": 0, "maxPayloadSize": 0}, 40 "filter": { 41 "supported": True, 42 "maxResults": get_system_settings().pagination_default_page_size, 43 }, 44 "changePassword": {"supported": False}, 45 "sort": {"supported": False}, 46 "etag": {"supported": False}, 47 } 48 )
Get ServiceProviderConfig