2

I followed this tutorial and completed setup, but I do not understand how do I use it in Micronaut? Please help me with the following?

  1. Using io.micronaut.context.env.Environment I can load specific certificate, but is this loaded from X.509 Certificate text or I should create a publi.cert file from keytool?
  2. In okta developer console do I need to configure my application controller, so that this gets called on login, as I always get 405 Method Not Allowed when I hit http://localhost:4200/xxx/api/sso/saml?

update

  1. Also, how do I make use of the above "Setup Instructions" screenshot in my micronaut application, as it says SAML 2.0 is not configured in https://developer.okta.com? How should the AuthenticationController be called, is it a redirect in case of UnauthorizedError to this controller with relevant SAML Response and RelayState? How do I get this SAML Response? enter image description here
    @Controller('/xxx/api/sso')
    @Slf4j
    @CompileStatic
    class AuthenticationController {
        private final String DEFAULT_PERSONA = "DEFAULT"
        private static final Logger _authLogger = LoggerFactory.getLogger("AUTH_LOG");
        @Inject UserService userService

        @Value('${sso.issuer}')
        String SSO_SAML_ISSUER

        @Post('/saml')
        @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
        @Produces(MediaType.TEXT_HTML)
        HttpResponse<String> samlLogin(@Nullable @Body LinkedHashMap payload) {
        ...

Please help me understand integrating SAML 2.0 okta authentication with micronaut application.

How do I use the "Setup Instructions" in micronaut application?

Ricky
  • 314
  • 1
  • 7
  • 22
  • You said you get a 405 "when I hit http://localhost:4200/xxx/api/sso/saml". How are you hitting it? If you are just putting that in a browser address bar I would not expect that to work because your `samlLogin` method looks like it is configured to accept `POST` requests. – Jeff Scott Brown Apr 30 '19 at 18:31
  • @JeffScottBrown I tried postman as well as from UI code – Ricky Apr 30 '19 at 21:45
  • What HTTP request method are you using? Your code says that only a `POST` should be allowed and the 405 suggests you are using something other than a `POST`. – Jeff Scott Brown May 01 '19 at 01:41
  • @JeffScottBrown Thanks for pointing out, I tried it with POST in postman, it worked. I have updated my question asking for a bit more clarification. – Ricky May 01 '19 at 18:08

0 Answers0