@@ -193,6 +193,16 @@ def clean(self):
193193 ):
194194 raise ValidationError (_ ("You cannot use HS256 with public grants or clients" ))
195195
196+ def get_absolute_url (self ):
197+ return reverse ("oauth2_provider:detail" , args = [str (self .id )])
198+
199+ def get_allowed_schemes (self ):
200+ """
201+ Returns the list of redirect schemes allowed by the Application.
202+ By default, returns `ALLOWED_REDIRECT_URI_SCHEMES`.
203+ """
204+ return oauth2_settings .ALLOWED_REDIRECT_URI_SCHEMES
205+
196206 def get_cors_header (self , origin ):
197207 """Return a proper cors-header for this origin, in the context of this
198208 application.
@@ -211,16 +221,6 @@ def get_cors_header(self, origin):
211221 return origin
212222 raise Application .NoSuitableOriginFoundError
213223
214- def get_absolute_url (self ):
215- return reverse ("oauth2_provider:detail" , args = [str (self .id )])
216-
217- def get_allowed_schemes (self ):
218- """
219- Returns the list of redirect schemes allowed by the Application.
220- By default, returns `ALLOWED_REDIRECT_URI_SCHEMES`.
221- """
222- return oauth2_settings .ALLOWED_REDIRECT_URI_SCHEMES
223-
224224 def allows_grant_type (self , * grant_types ):
225225 return self .authorization_grant_type in grant_types
226226
@@ -242,6 +242,9 @@ def jwk_key(self):
242242 return jwk .JWK (kty = "oct" , k = base64url_encode (self .client_secret ))
243243 raise ImproperlyConfigured ("This application does not support signed tokens" )
244244
245+ class NoSuitableOriginFoundError (Exception ):
246+ pass
247+
245248
246249class ApplicationManager (models .Manager ):
247250 def get_by_natural_key (self , client_id ):
0 commit comments