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" 

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.