Accessing OAuth Servers using Flurl

If you have Flurl installed, and you need your client to authenticate against an OAuth2 server, like Identity Server, you can use their client library, which does everything for you (without Flurl), or you can do it yourself.

below is my DIY version.

private const string SECURITY_HOST = "your security host.";
private const string API_HOST = "your test api host";

string.WriteTitle() & string.WriteContent() are extension methods I slapped together to dump the information to the console screen, formatted.

"Ready to start with Flurl...".WriteTitle();
Console.ReadLine();
 
// discover endpoints from metadata
var discoraw = await SECURITY_HOST.AppendPathSegments(".well-known","openid-configuration").GetAsync();
var contentraw = await discoraw.Content.ReadAsStringAsync();
$"Discovery: {discoraw}".WriteContent(title: "Discovery");
$"Disco Content: {contentraw}".WriteContent(title: "Discovery");
var disco = JsonConvert.DeserializeObject(contentraw);
 
// request token
var authorizationAddr = (string)disco.token_endpoint;
 
var authorizationObj = await authorizationAddr.PostUrlEncodedAsync(new { client_id = "client", client_secret = "secret", grant_type = "client_credentials", scope="api1" });
var authorizationString = await authorizationObj.Content.ReadAsStringAsync();
$"Token Response: {authorizationString}".WriteContent(title:"Authorization");
 
var tokenContainer = JsonConvert.DeserializeObject(authorizationString);
  
var apiCall = await $"{API_HOST}/identity".WithOAuthBearerToken((string)tokenContainer.access_token).GetAsync();
 
var apiCallResponse = await apiCall.Content.ReadAsStringAsync();
 
$"Claims from API: {apiCallResponse}".WriteContent(title:"API Call");
 
"Press any key to continue...".WriteTitle();
Console.ReadLine();

Enjoy!

Posted in Brian By Experience | Leave a comment

Government is a bad idea.

Government is a bad idea. Ask where government is and you are pointed to a building. Is a building government, no its the people.

Find a person and ask them if they are government, if they say yes, then find their authority and they will change their story to they are either a part of government, or work for government.

Find who they work for, and you are directed to another tool of the delusion called government. This repeats until you are directed to a politician.

Are you, mister politician government? Mostly they will reply that they are just doing the will of the people, and just a part of what is government.

Government is a bad idea. It is the false assumption that saying it is so makes it so. It is the belief that paper and ink hold power and authority. It is the mistaken authority that giant temples of stone, glass, and concrete, used as tribute to this delusion is a thing called government.

If government is anything, it is silence, when evil is done in public, because it wasn’t done to me. It is violence, when someone does or says something that challenges my perception of reality. It is hate and greed, the thing of envy, that claims that it must be fed the abundance of the masses in justification of its existence. It is the toxic meme that makes sane men violence, and peaceful men power hungry. It is the hole the when fed only grows larger, wanting to devour more.

Government isn’t a thing, but it has life. It isn’t an idea, but it create new temptations for benevolence, and turns them into violence. Government is the great devourer, in search of its next prey.

Posted in Brian By Experience, Liberty | Leave a comment

Wisdom

There are three tiles of fights:

  • Those that help you grow
  • Those that tear you down
  • Those that should not be fought

Wisdom is knowing the difference, and knowing how to deal with each.

  • a wise rabbi
Posted in Brian By Experience | Leave a comment

Know your value, and don’t be a vampire.

Becoming uninspired is a side effect of having one’s life drained out of them.

Do not hang around or work for vampires. They are people who think exchanging money of life is equitable, and the one providing life doesn’t know any better.

One should always find value in their own life so that when they do exchange it for something like money, they get full value. Also they should pick clients for their time that will help nurture their own life, so the return on investment is of the highest value.

As for the vampires, the are generally not doing this out of maliciousness, but after pursuing the wrong fruit. Invest into one’s labor and they will provide better fruit for one’s return. Also not all laborers need the same type of investment, sometimes it is as simple as coaching.

Posted in Brian By Experience | Leave a comment

Today is another day that Govt proves that they think I am their property

So I am finally doing my taxes, and if I file correctly, I will owe somewhere between $1800 to $10000. And there is a whole chance that I may not owe anything, but will be due $600.

Why is this so flipping confusing?

  1. Its government. By default these people want you to just give them your whole paycheck, and more, and they just give you your daily bread, while you work your balls off. There is no justice or equity here.
  2. This collective of oppressors, called government, do not get the idea that I am not their bank account, and that they cannot steal from me and be called moral.
  3. To claim a percentage of my income, is to claim a percentage of my labor, which is to claim a percentage of my life, which is slavery.
  4. Government is a slave master, with the intent on owning everything from its slaves.

What is next?

  1. I have a call into my tax lawyer, with the intent of clearing up what I earned vs owed. It cannot be this difficult.
  2. I have to start taking my actions in promoting economic freedom more seriously. These laws by the government are a complete joke, and a violation of the 4th and 5th amendment. However, I know that if I fight this in court, then I will have a RICO case to fight too, since the IRS is the strong arm of the government for extorting money from the people.
Posted in Brian By Experience | Leave a comment

What is means to be seeded in Christ.

When you seed a plant, you are committing that seed to the soil, for the purpose of that seed being fruitful. When God seeds His word in us, it is with the intent of it producing fruit after its own kind. Words of salvation are to bare fruits of salvation. Words of righteousness are to bare fruits of righteousness. But these fruits, when they are spiritual are out of the reach of corruption. This is the importance of Christ Jesus (Messiah Yeshua), as that he is the first seed to a nation of priests, followers of God, according to his holy actions in life. He took our sin at the cross, and washed us with his blood to make us sin free.

Lets look at what this means. Romans 4.

  1. “BLESSED ARE THOSE WHOSE LAWLESS DEEDS HAVE BEEN FORGIVEN, AND WHOSE SINS HAVE BEEN COVERED
  2. “BLESSED IS THE MAN WHOSE SIN THE LORD WILL NOT TAKE INTO ACCOUNT.”

What is it to be covered? This refers to being covered by the blood of the lamb.

Rev 7: 14 I said to him, “My lord, you know.” And he said to me, “These are the ones who come out of the great tribulation, and they have washed their robes and made them white in the blood of the Lamb.

Rev 12:11 And they overcame him because of the blood of the Lamb and because of the word of their testimony, and they did not love their life even when faced with death.

John 1:29 The next day he saw Jesus coming to him and said, “Behold, the Lamb of God who takes away the sin of the world!

Exodus 29 [The chapter shows the proper use of the blood of the lamb. It is a consecration and an anointment. It is the declaration of the redemption. In this case, Aaron and sons were anointed with blood and oil to be the priests of God.]

1 Cor 6:9 Or do you not know that the unrighteous will not inherit the kingdom of God? Do not be deceived; neither fornicators, nor idolaters, nor adulterers, nor effeminate, nor homosexuals, 10 nor thieves, nor the covetous, nor drunkards, nor revilers, nor swindlers, will inherit the kingdom of God. 11 Such were some of you; but you were washed, but you were sanctified, but you were justified in the name of the Lord Jesus Christ and in the Spirit of our God.

So lets look at verse 7 again.

  • Blessed are those whose lawless deeds have been forgiven, and whose sins have been washed in the blood, and hence anointed.

What is it to be forgiven

  • Lev 4:31 ‘Then he shall remove all its fat, just as the fat was removed from the sacrifice of peace offerings; and the priest shall offer it up in smoke on the altar for a soothing aroma to the LORD. Thus the priest shall make atonement for him, and he will be forgiven.
  • Num 15:25 ‘Then the priest shall make atonement for all the congregation of the sons of Israel, and they will be forgiven; for it was an error, and they have brought their offering, an offering by fire to the LORD, and their sin offering before the LORD, for their error
  • Psa 32:1 A Psalm of David. A Maskil. How blessed is he whose transgression is forgiven, Whose sin is covered!

Sin is a debt that is owed for disobedience. Think of it as the price of shoplifting, or speeding. However, all penalties of sin are in all practice is death. “The wages of sin is death”. So how does one pay for that debt? You have someone who can pay for it cover your debt for you. In this case, Jesus Christ (Messiah Yeshua)

So lets look at verse 7 for the 3rd time, and 8 for the 2nd.

  • Blessed are those whose lawless deeds (sin) have been paid for by the lamb of God, and whose very same sins have been washed away in the blood, and hence anointed.
  • Blessed is the man whose sins (now washed away) the Lord will not take into account.

If it is washed away, then it cannot be taken in account. If God kept it in account, then why wash it away. Either you are freed from that penalty or you are not. No middle ground exists.

Heb 10:11 Every priest stands daily ministering and offering time after time the same sacrifices, which can never take away sins; 12 but He, having offered one sacrifice (Jesus, Yeshua, the lamb of God) for sins for all time, SAT DOWN (Rested, because the work was done) AT THE RIGHT HAND OF GOD, 13 waiting from that time onward UNTIL HIS ENEMIES BE MADE A FOOTSTOOL FOR HIS FEET. 14 For by one offering He has perfected for all time those who are sanctified.

This narrative below, from Isaiah 43, walks us from sin, to the reason for our salvation, and to the retribution for that sin.

(Listing of the sin)
22 “Yet you have not called on Me, O Jacob;
But you have become weary of Me, O Israel.
23 “You have not brought to Me the sheep of your burnt offerings,
Nor have you honored Me with your sacrifices.
I have not burdened you with offerings,
Nor wearied you with incense.
24 “You have bought Me not sweet cane with money,
Nor have you filled Me with the fat of your sacrifices;
Rather you have burdened Me with your sins,
You have wearied Me with your iniquities.
(But what God is willing, and wanting to do)
25 “I, even I, am the one who wipes out your transgressions for My own sake,
And I will not remember your sins.
26 “Put Me in remembrance, let us argue our case together;
State your cause, that you may be proved right.
(Where did this start)
27 “Your first forefather sinned,
And your spokesmen have transgressed against Me.
(And this is what will happen)
28 “So I will pollute the princes of the sanctuary,
And I will consign Jacob to the ban and Israel to revilement.

This is past tense, and for the tribe of Israel, but this is the pattern that God repeats through the bible. Why did the tribe of Israel spend 40 years in the wilderness? It was because the forefathers, who sinned multitude of times, needed to pass on, for the children to have a new chance at life. It wasn’t because their GPS was faulty.

Lastly

Rom 8:37 But in all these things we overwhelmingly conquer through Him who loved us. 38 For I am convinced that neither death, nor life, nor angels, nor principalities, nor things present, nor things to come, nor powers, 39 nor height, nor depth, nor any other created thing, will be able to separate us from the love of God, which is in Christ Jesus our Lord.

Posted in Christ, Christian Freedom!, Christianity | Tagged | Leave a comment

Do not waste your resources when there is no fruit to your investment.

The opposites of love are fear and unearned greed. Both lead to violence against other people. Either through stealing their stuff, rather than trading for it; or attacking others rather than providing a hand up.

No man deserves a hand out, but all men deserve a hand up. Motivate them to grow and compete. Help them find their drive to realize their potential.

A hand out is given from pity sake. A hand up is providing a step for a person to climb out of where they are not.

A hand out is generally provided by taking from something that could have used those resources better, and helped more. A hand up invests into people, with an expectation of return.

The return and the investment does not need to be cash. I invest wisdom, with the expectation of discussion and sharing with others as the return of my investment. I invest cash, when my expectation is that the person I invested into grows their life into a new powerhouse.

I despise altruism, because I suffer from not making sure that I live to continue to do my best. But I give abundantly, not because of altruism, but because cancers of society is government, cancer of the mind is ignorance, cancer of the body is disease, and more. I donate to a few charities, such as AIDS foundation, and CHOC, because I want people who are running out of options to have a fighting chance to all new options.

Mostly I donate my time and money to moving against hopelessness. In that I donate Christ to those who have not heard, and resources to those who need assistance.

I just try to be wise with my resources, because a charlatan shall never feed at my table, without first laying down his sinful ways. This includes politicians, and that wealthy guy from Africa who has been dying for 20 years and yet is still trying to give away his billions.

So what to take from this? Do not waste your resources when there is no fruit to your investment.

Posted in Brian By Experience, Christianity, Liberty | Leave a comment