File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ import bottle
2
+ from bottle_oauthlib .oauth2 import BottleOAuth2
3
+ from oauthlib import oauth2
4
+
5
+ app = bottle .Bottle ()
6
+ app .auth = BottleOAuth2 (app )
7
+ app .authmetadata = BottleOAuth2 (app )
8
+
9
+ oauthlib_server = oauth2 .LegacyApplicationServer (oauth2 .RequestValidator ())
10
+ app .authmetadata .initialize (oauth2 .MetadataEndpoint ([oauthlib_server ], claims = {
11
+ "issuer" : "https://xx" ,
12
+ "token_endpoint" : "https://xx/token" ,
13
+ "revocation_endpoint" : "https://xx/revoke" ,
14
+ "introspection_endpoint" : "https://xx/tokeninfo"
15
+ }))
16
+
17
+
18
+ @app .get ('/.well-known/oauth-authorization-server' )
19
+ @app .authmetadata .create_metadata_response ()
20
+ def metadata ():
21
+ pass
22
+
23
+
24
+ if __name__ == "__main__" :
25
+ app .run () # pragma: no cover
You can’t perform that action at this time.
0 commit comments