go to post Amy Lin · Dec 4, 2023 GetAuthorizationCodeEndpoint() needs to be called from a valid %session. One way to do this is extend from %OAuth2.Login.
go to post Amy Lin · Dec 4, 2023 To set up IRIS as an authorization server, you will need to set up the necessary configurations in System Administration>Security>OAuth2.0>Server Configurations. Many of these will depend on how you want your application to be interacting with the authorization server. There are also a few classes in %OAuth2.Server.* that you can overwrite to customize the authentication or validation process. For example, setting it so only certain users can request tokens. To set up IRIS as a resource server, you will want to set up IRIS as a OAuth2.0 Client and specify the type as "Resource Server". You'll need to make sure that validate the access token. More information can be found in documentation under "Identity and Access Management"
go to post Amy Lin · Dec 4, 2023 These endpoints only return the url. They need to separately be sent as a HTTP request in your authorization process.
go to post Amy Lin · Sep 1, 2023 Your method is declared with "Method getIdByEmail(...". The "Method" keyword marks it as an instance method, which would need a class instance to access. Your unit test calls "##class(unitTests.sqlInscription).getIdByEmail(...", which is the syntax for calling a class method. You can declare your method with the "ClassMethod" keyword: "ClassMethod getIdByEmail(..." or you can instantiate your unitTests.sqlInscription class.
go to post Amy Lin · Jul 20, 2023 The return status for %OAuth2.JWT.JWTToObject() will validate signatures, though a JWT with "alg:none" will be validated too. Claims and expiration are not checked in JWTToObject() and should still be checked independently.