Setup custom auth and role in spring security
<p>I have extended <code>WebSecurityConfigurerAdapter</code> to configure custom authentication and authorization. I have introduced a new API say, "/v1/api". My requirement is as follows,</p>

<ol>
<li>This API is supposed to be called by an entity with role "API_ROLE" and no one else</li>
<li>Also a person with "API_ROLE" should not be able to call any other API in the system.</li>
</ol>

<p>How would my configuration look like?</p>

<pre><code>@Override
protected void configure(HttpSecurity http) throws Exception {
    http.authorizeRequests().antMatchers("/v1/api**").hasAuthority("ROLE_API");
</code></pre>

<p>The above code achieves the 1 purpose, how do I block person with this role to hit any other API?</p>