SpringBoot + Web API Bearer Token Security against AzureAccessing Azure web sites from Visual StudioAuthenticate against an Azure Mobile Service App with ADAL.js acquired tokenPossible to get Azure AD Application name from Bearer Token?Get username linked to Azure AD bearer tokenUnable to use bearer token to access AAD-secure Web APIAuthenticate Web App against API App using Azure AD bearer tokenRetrieve Access Token within a AAD secured Azure Web AppHow do I get the bearer token claims that azure b2c promises?Bearer token not working when calling web api in AzureInvalidating Azure AD Bearer Token on LogOut
How to limit Drive Letters Windows assigns to new removable USB drives
Pre-plastic human skin alternative
Can SQL Server create collisions in system generated constraint names?
Why did some of my point & shoot film photos come back with one third light white or orange?
Is there really no use for MD5 anymore?
What's the polite way to say "I need to urinate"?
"The cow" OR "a cow" OR "cows" in this context
How to stop co-workers from teasing me because I know Russian?
What is the smallest unit of eos?
Are there physical dangers to preparing a prepared piano?
How can I print the prosodic symbols in LaTeX?
Why does Mind Blank stop the Feeblemind spell?
Implications of cigar-shaped bodies having rings?
Is Diceware more secure than a long passphrase?
How did Captain America manage to do this?
How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?
can anyone help me with this awful query plan?
On The Origin of Dissonant Chords
Two field separators (colon and space) in awk
How can the Githyanki Supreme Commander move while insubstantial?
Why does nature favour the Laplacian?
Was there a shared-world project before "Thieves World"?
Minor Revision with suggestion of an alternative proof by reviewer
Was there a Viking Exchange as well as a Columbian one?
SpringBoot + Web API Bearer Token Security against Azure
Accessing Azure web sites from Visual StudioAuthenticate against an Azure Mobile Service App with ADAL.js acquired tokenPossible to get Azure AD Application name from Bearer Token?Get username linked to Azure AD bearer tokenUnable to use bearer token to access AAD-secure Web APIAuthenticate Web App against API App using Azure AD bearer tokenRetrieve Access Token within a AAD secured Azure Web AppHow do I get the bearer token claims that azure b2c promises?Bearer token not working when calling web api in AzureInvalidating Azure AD Bearer Token on LogOut
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am new to Springboot so please bear with me. We have a Springboot Web App which exposes multiple endpoints (/order , /modes). These APIs will be called from different web services (sitting in Azure) and they will each pass Authorization Bearer Token(Individual Azure App Client ID) in the call for Authentication to our App.
So we want to secure our App, to accept this token and allow calls only if the token is valid.
I was able to secure the springboot app for user login, but not if any service calls via Bearer token. Can you please help with this.
I followed solution provided in this blog, but it only accepts token genearted by a single Client ID http://blog.xebia.in/index.php/2017/12/21/spring-security-and-oauth2-with-azure-active-directory/
As of now below is what I have as part of security in my code, which does user based authentication
@Autowired
private AADAuthenticationFilter aadAuthFilter;
@Autowired
private OAuth2UserService<OidcUserRequest, OidcUser> oidcUserService;
@Override
protected void configure(HttpSecurity http) throws Exception
http.csrf().disable().authorizeRequests().antMatchers("/actuator/health").permitAll();
http.csrf().disable().authorizeRequests().anyRequest().fullyAuthenticated().and().oauth2Login()
.userInfoEndpoint().oidcUserService(oidcUserService);
http.addFilterBefore(aadAuthFilter, UsernamePasswordAuthenticationFilter.class);
Thanks,
Anju
azure spring-boot
add a comment |
I am new to Springboot so please bear with me. We have a Springboot Web App which exposes multiple endpoints (/order , /modes). These APIs will be called from different web services (sitting in Azure) and they will each pass Authorization Bearer Token(Individual Azure App Client ID) in the call for Authentication to our App.
So we want to secure our App, to accept this token and allow calls only if the token is valid.
I was able to secure the springboot app for user login, but not if any service calls via Bearer token. Can you please help with this.
I followed solution provided in this blog, but it only accepts token genearted by a single Client ID http://blog.xebia.in/index.php/2017/12/21/spring-security-and-oauth2-with-azure-active-directory/
As of now below is what I have as part of security in my code, which does user based authentication
@Autowired
private AADAuthenticationFilter aadAuthFilter;
@Autowired
private OAuth2UserService<OidcUserRequest, OidcUser> oidcUserService;
@Override
protected void configure(HttpSecurity http) throws Exception
http.csrf().disable().authorizeRequests().antMatchers("/actuator/health").permitAll();
http.csrf().disable().authorizeRequests().anyRequest().fullyAuthenticated().and().oauth2Login()
.userInfoEndpoint().oidcUserService(oidcUserService);
http.addFilterBefore(aadAuthFilter, UsernamePasswordAuthenticationFilter.class);
Thanks,
Anju
azure spring-boot
Is your scenario similar to docs.microsoft.com/en-us/azure/active-directory/develop/…
– Tony Ju
Mar 25 at 1:55
add a comment |
I am new to Springboot so please bear with me. We have a Springboot Web App which exposes multiple endpoints (/order , /modes). These APIs will be called from different web services (sitting in Azure) and they will each pass Authorization Bearer Token(Individual Azure App Client ID) in the call for Authentication to our App.
So we want to secure our App, to accept this token and allow calls only if the token is valid.
I was able to secure the springboot app for user login, but not if any service calls via Bearer token. Can you please help with this.
I followed solution provided in this blog, but it only accepts token genearted by a single Client ID http://blog.xebia.in/index.php/2017/12/21/spring-security-and-oauth2-with-azure-active-directory/
As of now below is what I have as part of security in my code, which does user based authentication
@Autowired
private AADAuthenticationFilter aadAuthFilter;
@Autowired
private OAuth2UserService<OidcUserRequest, OidcUser> oidcUserService;
@Override
protected void configure(HttpSecurity http) throws Exception
http.csrf().disable().authorizeRequests().antMatchers("/actuator/health").permitAll();
http.csrf().disable().authorizeRequests().anyRequest().fullyAuthenticated().and().oauth2Login()
.userInfoEndpoint().oidcUserService(oidcUserService);
http.addFilterBefore(aadAuthFilter, UsernamePasswordAuthenticationFilter.class);
Thanks,
Anju
azure spring-boot
I am new to Springboot so please bear with me. We have a Springboot Web App which exposes multiple endpoints (/order , /modes). These APIs will be called from different web services (sitting in Azure) and they will each pass Authorization Bearer Token(Individual Azure App Client ID) in the call for Authentication to our App.
So we want to secure our App, to accept this token and allow calls only if the token is valid.
I was able to secure the springboot app for user login, but not if any service calls via Bearer token. Can you please help with this.
I followed solution provided in this blog, but it only accepts token genearted by a single Client ID http://blog.xebia.in/index.php/2017/12/21/spring-security-and-oauth2-with-azure-active-directory/
As of now below is what I have as part of security in my code, which does user based authentication
@Autowired
private AADAuthenticationFilter aadAuthFilter;
@Autowired
private OAuth2UserService<OidcUserRequest, OidcUser> oidcUserService;
@Override
protected void configure(HttpSecurity http) throws Exception
http.csrf().disable().authorizeRequests().antMatchers("/actuator/health").permitAll();
http.csrf().disable().authorizeRequests().anyRequest().fullyAuthenticated().and().oauth2Login()
.userInfoEndpoint().oidcUserService(oidcUserService);
http.addFilterBefore(aadAuthFilter, UsernamePasswordAuthenticationFilter.class);
Thanks,
Anju
azure spring-boot
azure spring-boot
asked Mar 22 at 17:26
AnjuAnju
1
1
Is your scenario similar to docs.microsoft.com/en-us/azure/active-directory/develop/…
– Tony Ju
Mar 25 at 1:55
add a comment |
Is your scenario similar to docs.microsoft.com/en-us/azure/active-directory/develop/…
– Tony Ju
Mar 25 at 1:55
Is your scenario similar to docs.microsoft.com/en-us/azure/active-directory/develop/…
– Tony Ju
Mar 25 at 1:55
Is your scenario similar to docs.microsoft.com/en-us/azure/active-directory/develop/…
– Tony Ju
Mar 25 at 1:55
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55304895%2fspringboot-web-api-bearer-token-security-against-azure%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55304895%2fspringboot-web-api-bearer-token-security-against-azure%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is your scenario similar to docs.microsoft.com/en-us/azure/active-directory/develop/…
– Tony Ju
Mar 25 at 1:55