Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,336
Community Members
 
Community Events
176
Community Groups

Invalid redirect_uri

i tried to secure mt API in .Net Core 3.1, using OAuthentication with bitbucket client-id and clientSecret  ,

i am authenticated and then  i have "Invalid redirect_uri" error

here is the associated Url:

https://bitbucket.org/site/oauth2/authorize?client_id=xxxxxxxxxxx&scope=&response_type=code&redirect_uri=https%3A%2F%2Flocalhost%3A44377%2F&state=CfDJ8E2YW5aczspHtpcKCUDMSdbgg_7hYceedO7ugVfBCyZza0Rxq5uoBHPRvM8dxipLeZHNXnK_KEaV6SQuVhp-yRSBQzQ7ItQGhc7uS2oAWDp-z1hyTf70MmprHFXSQDQ4nKgb7KCvRtPb8ZJe4_wAVCaHDU-G15vzxeEw4u-zKVjv_kUA5JC9OFkw4tFrQgaJ92CCxDGDutdY38PVsDS65p4iOTWdQ0ACqY0jidEucAEK

 

 

 

i think that i have a probleme on "callbackPath"

------------------my code snippets---------------/////----------------------------------------

services.AddAuthentication(config =>

{ // we check cookie to confirm that we are authenticated
config.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
// when we sign in , we will deal out a cookie
config.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
// use this to check if we are allowed to do something
config.DefaultChallengeScheme = "OurServer";
}).AddCookie().AddOAuth("OurServer", config =>

{
config.ClientId = Configuration["OurServer:ClientId"];
config.ClientSecret = Configuration["OurServer:ClientSecret"];
config.CallbackPath = new PathString("/");
config.AuthorizationEndpoint = "https://bitbucket.org/site/oauth2/authorize"; //
config.TokenEndpoint = "https://bitbucket.org/site/oauth2/access_token";
config.SaveTokens = true;
config.Events = new OAuthEvents()
{
OnCreatingTicket = context =>
{
var accessToken = context.AccessToken;
var base64payload = accessToken.Split('.')[1];
var bytes = Convert.FromBase64String(base64payload);
var JSonpayload = Encoding.UTF8.GetString(bytes);
var claims = JsonConvert.DeserializeObject<Dictionary<string, string>>(JSonpayload);
foreach(var claim in claims)
{
context.Identity.AddClaim(new Claim(claim.Key, claim.Value));
}
return Task.CompletedTask;
}

};

}).AddOAuthValidation();

--------------------------------------/////----------------------------------------------

Does anyone have encountered this problem or know the solution?

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events