Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Created July 4, 2019 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamBien/87815259f16ea1080df7b34a394958f1 to your computer and use it in GitHub Desktop.
Save AdamBien/87815259f16ea1080df7b34a394958f1 to your computer and use it in GitHub Desktop.
65thAirhacksQ&A.md

Ask questions and see you at August, 5th, 6.PM. CET: http://www.ustream.tv/channel/adambien

Also checkout recent episode:

64th airhacks.tv

Please keep the questions Java EE-stic. Means: as short and as concise as only possible. Feel free to ask several, shorter questions.

@Tunjidir
Copy link

Tunjidir commented Aug 4, 2019

Hi adam. please how to exclude resource classes from being authenticated by the JavaEE 8 HttpAuthenticationMechanism. once implemented it secures every resource per default. i tried to define some security constraints in my web.xml but it doesn't seem to work. here's a copy of what my web.xml looks like. i get this WARNING: JASPIC: http msg authentication fail
java.lang.NullPointerException: Password value may not be null from payara 5.191 and a 401 unauthorized response.
Ideally i'd want every resource uri secured but the ones for registerations open since my identity store validates from Database

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Protected Area</web-resource-name>
            <url-pattern>/smart/resources/business/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
          <role-name>ADMIN</role-name>
        </auth-constraint>
    </security-constraint>
   <security-constraint>
    <web-resource-collection>
      <web-resource-name>un restricted access</web-resource-name>
      <url-pattern>/smartdealsng/resources/registrations/*</url-pattern>
    </web-resource-collection>
  </security-constraint>

    <security-role>
      <role-name>ADMIN</role-name>
    </security-role>
    
    <security-role>
      <role-name>USER</role-name>
    </security-role>

@altuga
Copy link

altuga commented Aug 5, 2019

Hello Adam

We are trying to migrate one small Spring project to Jakarta EE and we couldn't figure out exactly a shortcut about how to replace org.springframework.data.repository.CrudRepository utility.

I mean

import org.springframework.data.repository.CrudRepository;
public interface PostRepository extends CrudRepository<Post, Long> {

    Iterable<Post> findByUserId(Long userId);
}

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment