Hi everyone, welcome to the Octa developer stream. I'm Brian Demers and with me is Micah Silverman and Heather Downing Hey It's work today. We're gonna talk about hooks and web hooks and all that fun stuff, right?   And I'm Brian Demers Nice nice. All right. So Micah When I first came to octa a few years ago I remember we had a conversation about the cool things that you can do with automation and some like the different logs that octa will give you as a developer and I Remember meeting you at octane and we were talking about this cool way that you kind of folded in octa hooks into like one of our Games to win a t-shirt. All right. Can you start off with what the heck? I'm talking about in a much better way Yeah, so Awesome awesome intro and it's a great place to start with octa branding versus The rest of the world so hooks are web hooks There's no difference and we didn't invent it. We do something awesome with web hooks I think but we decided to call them hooks because it's catchy and it's One syllable and it distinguishes us but their web hooks and web hooks have been around for a while and Just you know top-level basic generally speaking a Web hook it just allows another service to call out to some endpoint that you've defined and Do some functionality and respond to that service. So it's a way to Extend an existing service in new and unique ways maybe mash up some APIs in ways they were never intended to be and do some pretty cool stuff and As much as I love octa, I thought I'd start out with like a super simple example from heroku because heroku makes it really easy to create add-ons and If you're not familiar with heroku Heroku is a is an app hosting platform and they have this giant library of add-ons and Anybody can go and create a heroku add-on and heroku calls them add-ons But the mechanism behind the scenes are web hooks. So if you've ever Deployed an app to heroku that had a requirement or or a dependency on postgres you go to the Heroku add-on Bizarre and you just add in postgres behind the scenes Heroku is making a request to some other service to go and provision postgres So I thought I'd start there because I wrote the octa heroku add-on and I got I got very familiar with Heroku's whole Whole system of doing that So I'm gonna share my screen. I'll make everything big here, but and this isn't kind of the main event This is where I just define this very simple add-on called octa hero cootest Fun fact you can't have the word heroku in your add-on. So Of course, I I said challenge accepted and so now it's hero coo But really what's happening here is I have this Definition in a manifest file that tells heroku where to call when I go to add This add-on to an app. So I have this app created. It's actually completely empty There's no code deployed at all, but I'm saying you know what I'd like to provision this add-on called octa heroku test for this app and Let me just make sure I have Breakpoints set here. This is about as simple a Java app Spring app as you can get it's gonna Receive this heroku provision request and all I'm doing here is writing out to Pretty printing that JSON request but I've preconfigured Heroku to To reach out to my service now. I'm sitting on my home Wi-Fi network behind my Router and firewall. So how is heroku gonna reach my little locally running app here? Well, there's this awesome service that you may or may not be familiar with called Engrock Engrock drills holes into your local environment so that you can test services From the outside in so I could give this URL to somebody and say hey test out this great program I wrote and it's a publicly routable domain that you get out of it and This is what allows us so I've configured heroku to hit this endpoint And so now I can test out this service without having to deploy it or set it up anywhere or anything like that So when I go heroku add-ons create Heroku is going to reach out and and hit this endpoint And I'll just set a break point here so that we can see that it's actually doing that So here we are we're at my break point I'm just gonna let it go and if we look at the console output This is the request that heroku sent in So we want to talk about like what or what makes a webhook a webhook. It's a service that you run That another service can call and can kind of ingest These restful requests so it sends in things like the name This is a name that heroku allocated. It's got a unique uuid that it may need to use later Importantly, it's got this callback URL because if you're provisioning a service like octa It may take it may take more than two seconds. And so this way The provisioning can be completely async and when it's done The add-on can use this unique callback to tell heroku that the provisioning is done and make it available to your app And that's exactly kind of the mode that I operated in here And so our output is it says it's being created in the app in the background the app will restart when it's complete We can check its progress Now this is heroku's system to show me the progress it just says that it's creating and in fact It's gonna say it's creating forever because I never created the code to to tell it that it was done and even if I go to Heroku interface here If you notice over here, it shows that I've added this add-on to this app and over here You get the three, you know like in progress dots and it's gonna stay that way indefinitely Actually for up to 12 hours. So heroku will wait 12 hours before it finally gives up and says provisioning failed The important bit here is that heroku called my service That's a webhook I can go ahead and delete it and When I delete it if I can find the right one destroy so add-ons destroy I Should have an endpoint that handles that deletion because maybe I need to delete something for my database So heroku attempted to reach out to my service again attempted to make a webhook It sent this delete request to this endpoint and it just resulted in a 404 because I didn't implement that but as far as heroku's concern it's done its job and It's no longer It's no longer associated with this app. So now I don't have any any add-ons So heroku is a great example of a webhook in general you know just kind of like the general mode of operation of webhooks how they work And and you know, hopefully that gives kind of an overview of like what is a webhook what makes something a webhook It's a service that you're running that That some other service is reaching out to sending in a restful request and you give a response that is something that it expects and They you know all the services that support webhooks will have Documentation and parameters around is it is it synchronous or asynchronous? How long can you wait to respond? You know how to handle edge cases and all that good stuff Yeah, I thought it'd be a good place to start I ran into this a little bit when I was working on some of the voice work so both Google and Alexa Tend to want to be configured with hooks that way So I would say that it's interesting to try and debug right if you don't think about the process With whether or not it's synchronous like that's if you can definitely run into some debug problems So what did octa do that? I should care Like what should I care about? Yeah, so you froze up for a second, but I think I got the question like what it octa do that that we should care about Great questions one thing I do want to kind of you know give a shout out for n grok because you mentioned debugging just in general Let me share my screen again because n grok has this n grok has this great interface to Be able to monitor the different kinds of requests that are coming by and and it gives you all kinds of detailed Information if you I know I know it's this way in spring boot But every like every three months or so I have to remember like how do I do verbose? output of incoming HTTP request and then I do like a half hour of research and I remember what? You know XML voodoo. I have to do to get all that log output Maybe it's that way in other frameworks. I don't know but If you're using n grok and it's sitting in between you can actually see all the the request The the body of the request the headers that it sent over you can see the off the the basic authorization that that Heroku sent to my app and so I had to configure my app to be able to handle that basic authentic authorization so Shout out again to to n grok for making it so easy to Debug stuff locally from the outside and to capture everything that's going back and forth And another bonus it does the TLS handling for you, too, right? So if you have You know an application running on you know port 80 on your machine and grok can be reached over HTTPS Yeah, that's right and and in this particular case I have a paid account thanks to octa And so I get to have a fixed subdomain which is awesome, but even if you don't have a paid account I think by default it gives you a random subdomain and they have a wild card cert So it'll still be protected by SSL and I think even on the free tier. I think you get something like four or six hours of Having this endpoint up and addressable and then after that you just have to restart and grok and you get a new subdomain So it's pretty it's pretty generous in like how you can use it even even for free So Heather asked the question about stuff that octa's done and this has become like over the course of the last Year, this is something that we announced that octane 2019 so in April of 2019 I guess So we're coming up on like a year and a half of it going from beta to early access and now to full production, but We have these different categories of web hooks in octa that Some of which are async and some of which are sync synchronous the the synchronous ones are things that you can do to You know to impact various types of Workflows in your interaction with octa So I guess it's worth taking us a quick step back and saying octa is an identity management platform And so anything that you're concerned with managing users Authenticating and authorizing users you offload that to octa so that you don't have to reinvent that wheel And what I have up here is just some of our Documentations the first the first one that I thought I'd show and then maybe we could talk about a little bit It's a very common kind of use case where very few of our customers even even like People who are doing hobby projects with octa very few of them come with like a totally green field situation They have you know, they've built something locally. Maybe they were using sequel server and on the back end or post-gres Hopefully they were you know storing their passwords and some protected way But now they want to you migrate an existing user base to octa And the way that we used to have to do that is we would have to run We would have to rely on our customers to do all the heavy lifting to migrate those users If they wanted to run alongside their current auth system so the typical scenario would be you have like a shim application that when you go to authenticate gathers those credentials that you just put in checks it against your legacy system if you get the thumbs up it then uses the Octa API to create that user and and set their password and we were able to use We were able to use web hooks to kind of streamline that whole process and it's a little this request here That's on my screen right now. It's a little arcane But the important thing here is that in the credentials part of the JSON rather than actually setting a password We're telling it that we're going to set it up as a default import hook and What that means is that we can create a user that's ready to be imported and then all we need you to do is To write some code that checks against that legacy system and gives a thumbs up or a thumbs down But octa will now automatically migrate that user that is if your service your web hook gives the thumbs up octa will take that plain text password and store it on the back end safely and and You know protected with with b crypt ashes and all the stuff that we do on the back end without you having to Worry about like provisioning and setting that user manually So I can actually copy this as is Because I cheated a little and set some of these variables in advance So also so that I wouldn't have to show you my my API token But all I'm gonna on you're no fun Right all I'm gonna do is create this user So I'm creating a new user in octa and typically let's say you have 10,000 users You would iterate over your database and you would create the users In octa using the data that you already have just without credentials All right, and I forgot that I was using curl But the important thing here is that the provider type has been set as as import So this is now a fully created active user, but this user can't yet Log in in a vacuum Because if we go to this Octa org that I have I created this pass this password import inline hook and You can see that octa is gonna reach out to my endpoint. This is how web hooks work So octa is gonna make a request of my my endpoint and And then it's up to me to say yes, that's the right password or no, that's not the right password and How did you get to that screen on the dashboard? Oh good point. So if you go to workflow and inline hooks You can then start adding inline hooks and you can see the different ones that we have in this case I did a password import hook and You fill out some form information like the url You can give it octa will send a basic authentication header Just for the purposes of demonstration. I left it blank not a great idea in real life and So then octa Whenever and this is a global setting right so now when any user goes to authenticate that is in that imported state It's gonna use this hook and this is kind of a subtle and important thing here you might think that oh man my you know my my Password import web hook is gonna get hammered by octa. It's only for users that haven't already migrated. So once the web hook gives the thumbs up and says that's a good password that user will transition From being provider type import to provider type octa and once it's provider type octa Then my web hook no longer gets called for that particular user So if I have 10,000 users and 9900 of them are already migrated It's only ever gonna call my web hook for that for those last 100 users that still have to migrate So now let's just get set up and configured forever Like what happens if I got my mother who doesn't want to log in but once a year to things like how yeah Yeah, it's a great question typically first of all, you know The the unsatisfying answer in our industry always is it depends but The the answer is that typically our customers will run like a 60-day or a 90-day program And at the end of which some high percentage like let's say 90% of their active users have migrated by that point For those users that are still in this import state You use the octa API to say give me all the users that are in this provider import and I'm gonna Initiate a password reset on each of those users and so now they're gonna get an email Saying hey, it's time to change your password and some percentage of those users will go and change their password you know with these kind of migration programs you don't you you typically don't catch every last user because some of them are inactive but It's the way to get like the vast majority within that 60 or 90 days will migrate and then some percentage of the remainder will migrate over time You know when they get that that email that says hey, it's time to change your password right and the the idea here too is that you're you're Taking the load off your support staff by not Resetting everybody's password right you're allowing them to log in from the user's perspective. It's it's it's you know It just works the way it did yesterday But you know some subset of users, you know, whoever doesn't love that's right Yeah, so I have an incognito window here now if I log in as It's other user that already has a password set in octa remember the password my my Password hook never gets hit that user is already an octa user not an import user However, if I log in as that user that I just created that's in that That's set to type import Right now I'm gonna type in anything here Octa doesn't know yet, but what octa is gonna do is it's gonna hit my password hook and Now it just passed in this request and I for those of you that are that are Java people if you're not Please don't hold it against me But for those of you that are Java people it's really easy to convert a JSON object to a map of string Object and you can have it nested and you know be as deep as it needs to it's kind of the the poor man's way to Start with model objects, but I can take a look at this request that's coming in and I can see that among the thing that's passing me all kinds of metadata event IDs and stuff like that and then Within that it's got this data and that data has Hold on. I got to keep digging into the layers here Hold on. I'm gonna turn off the So I find the right place here why while you're looking I do want to point out to that we do have a Java SDK around this But this this sort of shows more of a JSON view But so if you are a job developer you can check out our SDK for that which wraps it up in more of a DSL But yeah, that's right. You don't have to demonstration purposes. This is this is a good view Well, yeah, you don't have to you go around every SDK in every language has this implemented yet So it's good for us to know at a high level how we can just read the object I'm a dynamic developer. So of course I'm like, oh, yeah I can just use an anonymous object type and then as it comes in I can check against it But I think we have documentation around the JSON structure of what we're gonna get right Yep Yeah, that's exactly right. I can show that in just a sec But what I was looking for is you know buried in this request object is the username and password that the user put in and Octa's looking for a response from my webhook just to give it the thumbs up or the thumbs down Now I have it set up here to return verified by default, but let's let's let's change that to unverified I'm gonna set the value here and I may have to do it twice because I think the first request is the is like a Chorus request or something. Yeah, let me set that twice I'm gonna set that to unverified Then back over here. It just says unable to sign in so my request my webhook responded back to octa With the thumbs down basically and so our interface doesn't give you a lot of information about what went wrong It just says unable to sign in which is you know a good security practice now if I try to do this again This time I'll let it go through and now it's transitioned to Let it letting me finish creating this account in octa and now I'm fully authenticated as this user Isaac and I Don't you know what's funny? I might not remember what password I put in there But this time it shouldn't hit my webhook at all because now that user is Is fully trans transitioned over? See oh dang it But what I can do is just show you this really quick If we hit the I'm gonna do a little bit of Live coding here. What could go wrong API v1? users and I'll give it and I know you can't see that maybe you can't see that on the bottom of my screen, but it'll all become clear in just a second and Just need to look back and see what API token alright API token All right, so I'm just gonna hit the user's endpoint. This is the octa API and if I look at that Isaac Brock user, I can see that The provider type now is octa not import because that user has been fully migrated thanks to the magic of webhooks and that Matching that identity that we have here is based on their email address. Is that correct? Yeah, that's right in this particular case the glue if you will is is their email address It doesn't necessarily have to be we have we have customers that use other types of identifiers You know just like shipping companies that just use user IDs that are long numbers or something like that But for the purposes of demonstration, it's easy just to make it an email address Yeah, so so whenever you import your users you can associate whatever metadata you have at the time and you know If you have some internal ID you could look up on that ID versus an email address Yeah, and the the documentation that we have on this is is pretty extensive where you can You can do things like in that response that the webhook sends back You can do things like set custom profile attributes, you know as part of that migration, so it's pretty rich and You know, there are a lot of there are a lot of companies That do this sort of thing that have a Method for how you're gonna migrate your users, but they often involve a lot more heavy lifting on the customer's part And that's the way it used to be for us. It used to be that rather than us just respond rather than having our customers write a small piece of code that returns verified or unverified our Customers had a really get deep into the weeds of the octa API and go and You know create a user and set the password and activate the user kind of manage that whole life cycle on their own Now we have import is kind of a first-class citizen in the life cycle of an octa identity So that was pretty cool That is really cool. So is that what octa hooks means? It's an importation hook or are there different kinds of hooks There are different kinds of hooks. So that was an example of an inline hook And we have a couple of different other types of inline hooks. We have Registration hooks and we have token hooks The registration hook is just some additional validation verification that you might want to do at registration time and the typical example that that I've seen is you've written this app and When an octa, you know, maybe you have like a Cloud of applications and you have this new applications and before you allow a user a register for this new application You just want to validate some piece of information about them Maybe they need to have a password or rather a credit card on file Or maybe you want to do some external check that says they've even maybe this is a beta app and you only want Users that have been been invited. It's publicly available Anybody could go to the front door But you only want users that have been invited to go and be able to register for this beta app So you can use this registration hook and again It's kind of like a thumbs up thumbs down thing the octa will call your web hook and if the response says You know Essentially expresses Allow that user to register then octa will allow that user to register And if not then they they won't be able to register even though it's you know sitting there on the public web So in the past we kind of had two modes of operation It was either private and some you know You had to call up some help desk and say you know Give them your employee number and have them provision you for this application And then you could log in and set your password the first time or it was completely open anybody could register and This is kind of an in-between state where you can control who's allowed to register and and who's not The other type of hook which is which I think you know I have a bias when it comes to like OAuth is The token hook and that really adds a lot of a lot of power And that allows you to alter the contents of a JWT type token in flight Which is kind of a cool feat of engineering But more importantly usefulness for Octa customers so the idea you know with JWT's if you're not familiar part of the power of JWT's is that they're signed with a private key and You grab the public key and validate that signature which gives you a high degree of confidence that you can trust What's in the payload? That's kind of baseline JWT. So that's the benefit of it and in the past it's been really hard to Have any sort of dynamic interaction or dynamic Changes to that payload because it requires To re-sign if you if you change the payload and you don't re-sign the JWT it's Instantly invalid because the signature isn't going to match properly So what this and and part of the especially with octa part of the challenge is that we don't ever expose The private key used to sign JWT's to anybody not even internal employees So it's not like you could say well, I'll let octa sign my JWT's But when I want to I'll use that private key to do my own thing You don't have that option so what the inline token hooks allows you to do is Just like we saw before octa will reach out to your service and through JSON You can express changes or additions that you want to be included in that JWT and Then octa will add that those claims. That's key value pairs and JWT's are called claims Octa will update the payload and it will re-sign and it does all that in flight So you it really opens the door to a lot of dynamic behavior and and part of the part of the whole motivation for web hooks in general is to be able to kind of be future-facing and roll with Behaviors that might be requirements for your app that the service provider never accounted for, you know, so if you have some Interesting app that needs to add all kinds of claims on the fly There's no way that octa can anticipate that so we give you this mechanism now through these inline token hooks to be able to do that so You provide additional claims or maybe an alteration of existing claims octa Updates the JWT including re-signing it and then your application receives a JWT That's ready to be validated because the signature is correct So super super powerful and I really think we're kind of just scratching the surface On the types of use cases and the power that you can you know squeeze out of that that type of Hook and so we've kind of we've kind of given our customers all these tools And now we're seeing some some interesting emerging use cases for a long time We've had lots of requests of you know for this user. I want to have this set of claims for this other user I want a different set of claims and it's we've we've kind of twisted ourselves in pretzels in the past to try to make that Happen now with this inline token hook. You can just you can just do it the the one downside I will say is or the one challenge is that because This is a synchronous operation. It has to happen in flight Your web hook has three seconds to finish its job and if it doesn't complete successfully You're just gonna get the original token without any changes So that's something your app has to be prepared to deal with you can't assume your app can't assume that Claims are are gonna be there Because maybe that Token hook call failed for whatever reason so it just has to be able to deal with failures in an expanded kind of way But it's an interesting challenge. You have to write a program. That's that's Resilient enough to respond in three seconds, which in the in the context of the internet is actually pretty generous. I mean really If it's taken that long, there's something wrong anyway, you want it to be like, you know sub 100 millisecond ideally I mean, I do agree with you, but in my world of legacy applications. That's not always the case So it's good to know it's the same way actually. So this is not just an octa of idiosyncrasy and the same thing happens when I had worked with Amazon's Alexa service is that pretty much if your Hook did not respond within I believe it's like three to four seconds. It said, I'm sorry I can't actually reach this particular skill right now and that's that was the default what would happen for the user so it made it forced a lot of the companies that I worked with to make sure they refined their data down to like maybe a stored procedure so they can get things really quickly and Make sure they have a good trim microservice for this This is an excellent example of what a microservice should be for and not your ginormous Rest API, right? Yeah, it's fair. I mean, you know for user experience, right? If you're logging in you don't want to wait. I mean three seconds is a long long time, right? You know, so so you have the the call the octa octa has to deal with your your password or whatever, right? There's some crypt cryptographic Delay that has to happen and then we call out like so you are adding delay But you know like Mike said if you can respond, you know within 100 milliseconds a quarter second Then your user is not gonna not gonna really realize it and especially that's only once So that's when you log in and that token is valid for your you know some duration and you know Your service isn't connected isn't contacted again So maybe you can show me that list Micah of how if I'm starting from the beginning because there's all these options are already swimming I'm sure in the heads of our viewers Okay, you are talking about inline hooks, but there's also something on our site called event hooks How do we think about each of them? Like what does it mean to be an inline hook? And what does it mean to be an event hook because that's what if they search for hooks on our Documentation that's what they're gonna see. So how do I remember? What means what? Yeah, that's a great question You know with the the so event hooks are asynchronous and they're passive What what I mean by that is any Anytime you do anything Mainly write operations with an octa you change a password You authenticate a token is issued all of those types of events Are recorded in the system log The the event hook Makes it so that you can capture all those events in a very similar way that octa is built in system log already does So event hooks are are asynchronous and they're all about events that have that have happened in the octa org So, um, you know, there's no like, uh on the fly Alteration of event hooks or anything like that. They're really informational. It's also a great way like we integrate with You know splunk and data dog and sumo logic for Long-term capture and analysis of logs That's great, but This is a situation where if you're doing some casual Sort of data gathering you can set up event hooks and and have an endpoint that octa will call And just capture all of those events.  I mean it does expect a response But you know all octa does is call your endpoint send event json information and kind of you know octa's done It's up to you to capture that and do something with it. It's not that that kind of critical time window like inline hooks um password hooks registration hooks and token hooks are all synchronous because they're Dependent in some way. They're dependent on your response And they will time out and you know the kind of dynamic you were talking about with with alexa It's not going to wait forever for user experience sake. Um but they they are dependent on your service responding in a certain way and uh things kind of get interesting in that realm because um For instance, you were talking about with alexa like it'll it'll error out if if it takes too long um With with inline token hooks for instance octa made kind of an engineering and and just a general decision to say If your inline token hook times out rather than Generate an error condition and trip up your application octa's just going to return the default Token that it was going to return anyway. So you've already authenticated. It's not like a security risk It's just that you were intending to return some sort of enhanced token your service timed out So octa says well, I'm just going to return The original token that I was going to return anyway And that's where you know your your application might have to be a little smart in um in dealing with that but you know You have to make those calls when it's a synchronous hook Uh because there has to be some sort of uh reasonable timeout associated with it for user experience You know heroku By contrast just because of the way their add-ons work They give you a generous 12 hours to tell heroku That your provisioning is done And you know, I can't imagine a service that would ever really take that long but you know provisioning an octa org using the octa Heroku add-on does take about 40 seconds and heroku Commodates that and some provisioning takes longer. Some provisioning is quicker um But you get that kind of visual feedback of those of those three dots that says hey, we're still provisioning this this add-on um The the link that you put up is is a good one to to get some, you know concepts under your belt um for uh for those uh Uh different types of hooks and one thing that I wanted to show people Bear with me a second and I will share my screen one more time We have kind of this ongoing Developer challenge we used to just set this up for um for conferences And we kind of debuted this this web app at octane 19 and now Uh, we've run the app with different sub domains in I want to say a dozen or more conferences But uh, this is experience Dot octa challenge dot dev. So he just kind of made it generally accessible now And this first tier just walks you through some Uh, kind of general entry level type of interaction with octa's api. You create a user you create a group You create some apps But tier two is is where it gets interesting especially with uh today's topic because it's all about the different types of hooks And we actually exercise every hook except for the password import hook So you have event hooks registration hooks and this uh authorization section is all about those token inline hooks So this is publicly available. You just uh come over here and give us some minimal information and we this is uh Uh, all we ask is your name and an email address and then you go create an octa or And then it actually gives you a customized postman collection That you can use to follow along each of these uh use cases and scenarios. It shows you Oh my goodness. Yeah, so, um These two tiers are not dependent on each other too. So if all you care about is the hook stuff You don't even have to do the first one Um, but if you want to get familiar with the octa api in general, this is a good place to start It shows you your your progress as you uh, you know play the game so to speak Um, you know you download this postman collection And then you you can open that in postman and it's all set It's preset with your octa org And your api token and everything that you need to then Work through each of these little challenges um So that's a really good place to go to to you know, uh kind of dig into Uh more the meat of these of these different types of hooks that we have Okay, so For this one. Are you using an event hook or an inline hook for the developer challenge? Well, uh, both actually So you start out on this second tier You start out creating an event hook and you can actually see incoming events Through this little uh javascript app that we host on uh glitch So if you follow through this Example and get everything set up you'll actually see an interface where um You can start to see events coming in uh getting captured because of The event hook Set up and then from there you go the the last two here. So there's event hooks, which is our asynchronous hooks and our passive hook and then um the registration hook and the Inline token hook walks you through our synchronous Hooks and shows you how you can you know transform a Um an access token by adding additional information to it Okay, so the way that we think about this correct me if i'm wrong brian is that inline hooks are think about it that When the user is registering or logging in and basically once they hit the server And octa is in the process of creating or generating a token for them. It is in flight So while it's in line to go back to the user you can stop the process in that flow and either Um do you know check things on the background and you can say yes You can continue or no you can't or hey by the way I want to add some extra baggage onto your your claims there and then it goes But event hooks are observational, right? You don't stop the flow at all. They're just like a fyi This user just did a thing in case you want to fire an email in the background. Is that correct? I just want to make sure that i'm interpreting correctly Yep, you got it. So the the event hooks are more of a fire and forget You know and in the inline hooks are definitely uh, you can stop the world type of type of Have the power the power Yeah, so um I I uh, I wasn't sure if we'd have time to like actually look at some of this But let's see just for fun Why don't you and brian talk for a moment and I will see if I can't get the event hooks set up In the in the app here and we can actually see it in uh in action here All right, so you got a bunch of events that you can kind of you know observe, right brian I I haven't I don't have it up in front of me. Maybe you can grab What some of those are? What what do you think is the coolest one that you've been able to actually play with in a demo? Uh that you think would be useful because there's all sorts of different levels depending on who our users are Users meaning who are like our our customers are Yeah, so I think my favorite is the inline token hooks. So there's just a lot of power I mean, I know we touched on this earlier um in the password hooks great too, but the token inline hook I think is going to be the most used so it allows me to isolate You know some sort of custom logic and inject it into the user's flow So, you know, if I have some some spa application That needs access to some private data. I don't want my spa reaching out to some data source, right? I don't need to deal with any of that Octa can securely reach out to my service my service will respond to octa say yeah add my favorite color is blue And then now my my spa application knows my favorite color is blue without having to do an additional look up or You know try to deal with with uh, you know a separate request or figuring out how to authenticate You know my spy application to talk securely to my my api. I don't need to do any of that. It's it's already there Okay, so that means that it's just part of the token So when it deserializes you have that additional pieces of information instead of hold on Let me now that I have the token or the access token Now I have the ability to call octa's users api to get information about them back You don't have to because it just came in flight with it Absolutely And it's even better if you have you know, if I have a hundred different applications that I'll need You know some sort of subset of data I just can have one microservice to add that data to my token and then all of my applications could potentially have access to it Nice, so that means it could actually be stuff that isn't even stored in octa It could be stored in your own database that you add that's cool Absolutely. So it's my secret sauce right that that octa doesn't doesn't persist Uh, it sticks it in the token obviously to octa knows that token for for some period of time But we do not persist it octa doesn't store it So it's it's still your your data your ip whatever if those are your concerns I think for me when I was looking at event hooks. I'm really interested in like DDoS attacks I'm interested in in different kinds of ways that hackers would try And spam like perhaps my registration or whatever and I think observing Certain amounts of behavior is probably really useful So instead of it being in a black box that octa just has and you can just trust the logs You actually get to see the logs as they happen and you can perhaps send it off to another service to Also kind of take a look at and monitor Yeah, absolutely.  Sorry a user's login Now obviously some of those things you can do in the octa dashboard, right? But if you want to do something some advanced analysis on that data You can do it in real time as opposed to you know, sort of doing some some after the fact batch batch processing So let's say I'm part of a big company Like let's say an electric car manufacturing company and we have different divisions And so me as a developer, perhaps I'm only working on stuff that would be inside the car And that means that I may not have access to the entire octa org of users Can you do hooks at an application level or is it at more like at like a group Permissions level or is it really across the whole org? How does it work? That's a great question. So so the hooks are set up at an authorization server level But you have you have enough context that your hook can make a decision Based on that information, right? So so if i'm logging in and i'm calling a token inline hook My my handling application, right? Whoever's handling that webhook knows what scopes I have Potentially what groups I have my my email address whatever identifying information and then I can you know I can give them a different subset of data than I would you know, maybe an admin or or somebody So you definitely have the power So if I created my own let's say I only have control over the app that's in the car Right, but I don't have control over maybe their user's profile like somewhere else That means I could create my own authorization server and that way I would be able to do it at the auth server level Yep That's pretty cool So that means that you aren't married to the process for the entire company or the entire user base. You can do it per situation Absolutely Right for me I've noticed that there's a difference between a grandfathered in or perhaps a setup user account outside of my application And an application initiated registration that seems to be like a completely different flow Like the perhaps the user once we brand it may not even know that they are an octa user They'll just be like, hey, it's my cool car company's account At that point, right? So I've always been interested in how much of this is set up to where your user with many applications on like our octa dashboard Versus you don't know about the dashboard You just know about the app in the car and you just want to make sure you can log into it and change your stuff from there Yeah, so so I think that's the idea like, uh, you know, even as an octa employee, right? I think the ideal experience Is is your users don't don't know what authorization server using right? So it just just works everything's themed everything looks great Um, and it's all transparent to the user, you know on the back end the developer side You know, obviously we want to expose all of these things and make things powerful But from the user experience, they shouldn't have to deal with with any of that Right, um, I guess this is more we're thinking about Customer identity access management or people who are not within an organization So they may not even know that they're doing an import for example, like we have You know customers that are some of the largest social networks in the world, right? But you may not know that octa is the one who's handling some of that in the background Or you know, it's they don't want to see that that's what it is. That's different, of course, then hey you work at A carpet cleaning company and you know that you use octa because you have a dashboard with different apps that Is a single sign-on into all those apps So there's like a difference between whether or not your end users know Because they are part of your company or if they are external customers is a completely different experience Right. So the cool thing is that all the inline hooks work the same way for both of those cases So from the developer's experience You know, it's it's not different obviously from you know, how you architect and how you set things up, right? There's there's some concerns there, but But you know from from how how the all the the pieces fit and work together. It's all the same Awesome.  Yeah, so while you guys were having that interesting conversation I was sweating to see if this would work. You always run into the demo monster But I got it to the point now where we're ready to actually create the event hook in octa And I'll just show you this api call that it's about to make And when you set up event hooks you tell it the Life cycle or or the events that you're interested in capturing And there may be more than this at this point, but we listed a whole bunch of them So anytime What we're expressing here is that anytime any of these events fire within octa It's going to reach out to our application And send that event hook along for us to capture and maybe do something with So i'm going to call the octa api to set up this event hook And let's see. I got a 200 response. So that's good. I didn't break anything Um, and now it gives us this event hook id And so following uh back here that the the next thing that we need to do is to verify that event hook id and so, um In my set of environment variables here that come along with this collection I can set that hook id And now when I go to verify it if we look up here It's actually using if you're not familiar with postman One of the great things about it is that it can you can plug in these environment variables And if they're there it will use them And so now we can verify this event hook id and now its status is active So now any event that happens octa is going to fire off a request to our endpoint and show us information Uh, or or it'll just send the raw event data and then we do with it whatever we want And so now if I take this uh glitch app that I set up So now this app is waiting for events And so far it hasn't gotten any but let's see if I go over to um This kind of demo app that we use I had already authenticated here But let me go ahead and log out and let me um Let me log in once again And we should now be capturing some events. So I'm going to log in Incorrectly And then I'll log in correctly And it sends us back to this app in the meantime if we jump back over to here We can see now. This is kind of the raw data that octa is sending over to our event hook Um, so you can see here the latest event was session start um Somewhere in the list here. It should have Uh, the error that I put in there. Let's see. Let's see if I can find it It gives you all kinds of meta information the geolocation of the request So you get a tell yeah, here we go failure invalid credentials. So you get a ton of information from octa and Other services like I mentioned earlier sumo logic and others are you know, you can configure to ingest all this data But if you want to capture this data for whatever reason Um, you have the ability to wow look at this Verizon is my provider and it still shows up as mci communications That's like right out of the 90s Anyway, this is what This application this is how this application renders the JSON that it got from octa. So all octa is doing is Sending over this JSON data and like its job is done and then we have this application that's now rendering um That data for us for us to look at here and for for people that are interested I did all of this I mean you guys were talking for maybe five or seven or eight minutes I got all the way over to this point You know just navigating my way through this through this application and working with postman to get everything Set up. So it is kind of a handy tool to uh to learn about The uh the octa api and I wonder are we giving oh, yeah, look at this We're giving so if you go to experience dot octa challenge dot dev. We're actually Through our marketing department. We're giving away like t-shirts and water bottles and stickers and stuff So you actually can can get a prize if you go and uh play the developer challenge I know and we're going to have all sorts of fun um like hackathon style things happening soon I'm really excited to see what the community does with some of these hooks. I think it's going to be very um I want to see like how much automation can you put in in this flow to where you don't have to think about it Um, maybe you can use terraform or pilumi or something like that for some of this as well I think it'd be super cool to see how people set up some of their monitoring dashboards of like This is how much we're seeing so you don't you don't even have to log an octa at all because you can pull the data Into maybe your own database and you can put your own kind of visualizations up I think there's a lot here that will make you feel really Empowered when it comes to that. I know that we have about like five or ten more minutes So what do you think um is something that you would like to see? People mess around with when it comes to hooks that you haven't seen yet Well, I'll tell you one thing that i'm working on right now that I want to encourage everybody to do and that is I'm writing a little twilio integration where every time there's a An invalid login like I showed every time that event fires It's going to send a text message to brian to let him know that somebody didn't provide the correct credentials And anybody that wants to take this on I will gladly provide you with brian's phone number so that you can have it Send him messages also just you know want to put that out there But seriously though I am working on that as a little service like every time somebody has an invalid authentication It can fire off a text message saying hey somebody just tried to log into your app and they didn't they didn't they failed Like maybe this is something you want to look at That's pretty I think if anyone has a really cool unique idea that that you've done I think you should let us know Um send us an email at uh, what is it octa?  Thank you. And then and then we'll we'll find that we'll find a really cool one And we'll send you a t-shirt or uh, if you have a really great implementation And yeah Yeah, I like to mash up different apis make things work together that were never intended to do so so I have uh phone with that tweet tweet at mica, you know, you know every time you log in just Send send them. Yeah, that's right. Send me a private message at a fit nerd every time you log in You can do that with event hooks. Yeah Oh, uh, please don't do that for me. Uh, I already have to mitigate a lot of that stuff Oh my goodness. Well, thank you mica for showing us this I think that um I had no idea when I joined that octa even did this I was curious if this was something that like all external auth providers Have is this something that we can do and I think each one is a little bit unique as to what they offer Uh, but here it seemed like I just felt like I had way more control as a dev to the whole Flow process I suppose Uh specifically around like checking and some of the events. I think we're super cool. Like I I know I was part of a like a Words Heather marketing company for a long time And so knowing that a user had difficulty with their password or that they had issues logging in I could actually personalize an email to them or we could send that because we have their informational file We could send them Like a reminder sms about how to do things or whatever we wanted to do in that case you could use twillio for that, right? Um, I found I found it to be like just a world of possibilities that way that I just didn't see very often so That's very cool. Thank you so much for showing us that and for Brian for also chiming in on how everything works. Um, because People who are watching may not know this but both of you have worked in our engineering department before at octa before you moved over to advocacy, right? Yeah, I definitely spent uh, three three years or so on the octa engineering team Right, so if you have any really strong questions about why things are the way they are these two guys Which I where's direction are you? the other two people on the On the twitch stream are the ones you want to reach out to um, so i'm going to put up um, I'm going to go ahead and put my my twitter handle in our chat if you're interested in Like talking to me. I'm at quarrel line and you can definitely put yours in as well in case people want to continue the conversation over there Got it Got it awesome, so Thank you for happy hacking. Yes. Yes happy hacking


do you think led to all the good sales? Like what was it? Obviously, shark tank plays a role a little bit later, but what was it? For my product, so people aren't searching for a solution for this problem because it has never existed before. People have just dealt with it. So for me and my product, especially in the early stages, it was word of mouth and being endorsed. So I got picked up by the Good Housekeeping Institute, Tested Wadfri in their cleaning lab. They wrote about it in the Good Housekeeping Magazine. They called it genius.


Hello and welcome to the session. In this session we discuss the following question which says draw a rhombus whose side is 7.2 centimeters and one angle is 60 degrees. Now let's move on to the solution. First we construct a rough sketch of the rhombus with size 7.2 centimeters and one angle 60 degrees. Consider the rhombus a b c b with one side a b equal to 7.2 centimeters and one angle as 60 degrees. Now we shall construct the rhombus step by step. So first we draw a b equal to 7.2 centimeters. This is a b of length 7.2 centimeters. Now since a b c d is a rhombus so obviously a b c d is a parallelogram. Now we know that adjacent angles of a parallelogram are supplementary. So when you consider this rhombus a b c d we say that its adjacent angles say angle a plus angle b is equal to 180 degrees. Now we have that angle b is 60 degrees. So we have angle a plus 60 degrees is equal to 180 degrees which means that angle a is equal to 180 degrees minus 60 degrees equal to 120 degrees. Thus now we have in rhombus a b c d angle a is 120 degrees angle b is 60 degrees and a b is 7.2 centimeters. So in the last sketch we mark angle a as 120 degrees. Now in the next step we make angle x a b equal to 120 degrees angle y b a equal to 60 degrees. So this angle x a b is of measure 120 degrees and angle y b a is of measure 60 degrees. Now since a b c d is a rhombus all the sides of a b c d rhombus are equal that is we have a b is equal to b c is equal to c d is equal to d a is equal to 7.2 centimeters. So in the next step with a as the center and radius 7.2 centimeters cut an arc on ray x a. This arc is drawn with a as the center and radius 7.2 centimeters let this point be point d. Now in the same way in the next step with b as the center and radius 7.2 centimeters cut an arc on the ray y b. This arc is drawn with b as the center and radius 7.2 centimeters let this be point c. Now in the next step we join c d now we have joined c d so this a b c d is the required rhombus. This completes the session hope you have understood the solution for this question.


Hello everyone, welcome back to my first Minecraft video here on Ethan's journal So yeah, I could run down of what this Minecraft video is going to be about. I guess let's get started So this is a Minecraft server that me and my cousin run We've probably been doing it for about three months now And we've kind of gotten a few things settled here on this or I'll give you a quick tour before I start working on stuff But this is an AFK fish farm that I actually just made today And I was on here for about 30 minutes and I got some not the greatest loot, but not the best Not the worst, but not the best. These are all my dogs So we kind of have names for them based on our real life dogs. This is Gracie, Crimson, Onyx, and this out here is Bear and Over here is kind of like our sorting system. I guess you could say it's not sorting yet But it kind of has like all of our items in it When you go downstairs here, you have our downstairs basement with all of our Furnaces and crafting table Over here is the dog room. That's Evan's bedroom and then down there is mine And then when we come outside, this is a house that I worked on completely in survival mode I think it looks pretty good But this was a pretty much a month project based on like 10 minutes to 30 minutes a day working on it Over here. We have our cower our cow and sheep pens over there Right here. We have our another portal with copper that has started to oxidize And then over here is our little villager house and the villager we Transport it from a village way over there and he now is in here and he always likes to come and say hi Over here is like our wheat sugarcane and Potato and wheat farms over here and then over here is a mob farm that I built I guess a few days ago at this point And it's not the fastest because you still need to light up a lot of the caves But it's a pretty much a one-hit kill every time something comes down. It's not the fastest And then you can see there's a lot of torches because you tried lighting it up to make that go faster It it's a bit faster now, but at least it's working and then over here is that's our mining House there and that's pretty much a full rundown of the tour Oh, yeah, and then up there we have our lightning rod So the house doesn't get struck because if the house gets struck by lightning It's all coming down because it's pretty much all wood So we're trying to hope that will help us there and then there's a campfire from when we first started But yeah, essentially that's a rundown of our entire base here Personally, I have to I'm I want to start working on a spider farm to get some spiders Oh looks like we got another wolf over here. I have bones on me. See if I can tame another another wolf I every time I see a wolf I have to tame it Because I just want to have like an entire house of wolves like a wolf Sanctuary or something Hi, buddy. Oh my gosh. That was just one Come on home when I come home Come on. Sorry. That was a bit off-track, but yeah, come on buddy Let's go back to the house. You can meet all the other dogs. What's a name? What's a good name for you?  I wonder what a good name for him is gonna be But yeah, overall It's working pretty nicely. I guess We have a decent amount of torches as you can see and you're kind of getting situated And we basically just started we don't have we don't have as much diamond armor yet We don't have a lot of armor as it is as you can see I just have leather pants and iron boots that are about to break So not the best off yet, but we again we are still working Come on. Oh my gosh, you push the other dog in there.  We do bring them along So and if you're wondering what this thing over on the right side is it says number of mob deaths That was something we were trying out with a vanilla tweaks plug-in that didn't end up working And we don't think we needed it and now we just can't forget how to remove it But yeah, that's something I put in there just to try to see what it does But yeah, I'm gonna see if I can remove that eventually Um, yeah, we as you can see we've cut down a lot of trees over here We've tried to replant a few of them, but overall I kind of want to make this I want to transform it make it like open area for us to do things. I think that would look pretty good But yeah, we can head back over to the house here and figure out a Project to do in the next episode because so I'm gonna make like maybe short five 10-minute episodes Maybe once a week trying to I've kind of like improvements that we're doing here on the Minecraft server. Um, but yeah, this is an intro video So it's not gonna be as long as a normal video, but yeah, and there goes my connection So this happens a lot on the Minecraft server before I close the episode I kind of want to talk about this so at our house We have Starlink and my cousin has regular internet from Spectrum, but personally here we have a Starlink connection and Because of its obstructions, it'll frequently just time out on the server And this is something that hopefully will be fixed when winter comes because I live in Wisconsin and Winter's coming just a few months at this point And then there won't be as many leaves on the trees which should hopefully help our satellite have better connection to it But yeah, that's something that we have with here, but overall I guess I can say thank you guys for watching the video I'm gonna come up with one of these maybe in about a week's time as I do have school going on But yeah, I hope you guys enjoyed the video if you did be sure to like it And if you want to see more content from me be sure to subscribe with that notification bell And until then have a great issue day and goodbye


Respected viewers, brothers and sisters in Islam, As-salamu alaikum warahmatullahi wabarakatuh. Welcome to another episode of Life From Khilbelat with Meir host Ahmad Ali. Tonight, inshallah, we will continue our discussion, which we have been discussing over the past few nights, the topic of human rights in comparison between the justice and general respect of Ali ibn ibn Talib peace be upon him, and the declaration of the rights of man and the citizens of 1789. Over the past night, and especially yesterday, we examined the sayings of ibn ibn ibn peace be upon him and compared those sayings with the declaration. As a matter of fact, yesterday we examined the equity of Ali ibn ibn ibn Talib peace be upon him as well as the liberty and freedom that he allowed for the Muslims under his rule and compared that as well with the declaration. However, tonight we are going to examine and compare between the 6th, 7th, and 8th, and 9th article of declaration and the 1400 year old sayings of Ali ibn Talib peace be upon him. But before we commence further into the show and into the episode, let's welcome our very special guest who has joined us over the past few nights, Sayed Muzaffar al-Qazweeni. How are you Sayedna? How are you? How are you? Alhamdulillah. Alhamdulillah Sayedna. Sayedna, I as well as the respected viewers enjoyed the discussion around the knowledge and wisdom of Ali ibn ibn Talib from the first and second episode. If you can elaborate more on the knowledge of Ali ibn ibn Talib it would be great. When it comes to the knowledge of Amir al-Mumineen, Ali ibn Talib peace be upon him, I could give you a reference from the book of Ibn Hajar. Ibn Hajar, a well known scholar from the Sudan, in his book Lisan al-Mizan, the tongue of the scale it's translated to. The book in Arabic it's called Lisan al-Mizan. The second volume of his book, he gives us a hadith and that hadith is about the knowledge of Amir al-Mumineen, peace be upon him. He says Ibn Abbas, the cousin of Rasul Allah and Amir al-Mumineen, peace be upon him, gives us this tradition that he overheard Rasul Allah, peace be upon him, and said, I am the city of knowledge and Ali is the door to it. So the knowledge of Amir al-Mumineen, peace be upon him, is directly from Rasul Allah, and the knowledge of Rasul Allah, peace be upon him, is from Allah subhanahu wa ta'ala. Thus, Amir al-Mumineen, peace be upon him, can give us these pearls and the eloquent talks that he gave to his subjects, to his workers, and to the Muslims. Rasul Allah, peace be upon him, says I am the city of knowledge and Ali is its gate. The book of Ibn Hajar, Lisan al-Mizan, volume two. So this is a hadith that we can share and elaborate when it comes to the knowledge of Amir al-Mumineen, peace be upon him, before we enter our discussion. As I mentioned, our discussion will evolve around the sixth, seventh, eighth and ninth article of the declaration. The sixth article states that Allah is the expression of the general will. All the citizens have the right to contribute personally through the representatives to its formation. All the citizens being equal in its eyes are equally admissible to all public dignities, places and employments, according to their capacity and without distinction, other than that of their virtues and of their talents. This segment or article of the declaration is very significant when we examine it, as well as when we examine the things of Amir al-Mumineen 1200 years prior to this. Especially when we look at the letter between him and Malik al-Ashtar. Abir al-Mumineen, peace be upon him, gives Malik al-Ashtar, peace be upon him, instructions on how to choose his party or the members of his government. It's not based on ethnicity or race or what social class they come from. Amir al-Mumineen, peace be upon him, tells Malik al-Ashtar, then chooses the right between the people. Choose for your governance and positions in your government from the people. Those who are considered to be the best in society in which you, Malik, see them to be the best, most pious, when it comes to the people of Egypt and your citizens. So it's not based upon whether you're related to them or your friends with them. No, it's based on who's the best out of the Muslims or your citizens. Who has the ability to conduct, who has the ability to rule justly and rightfully amongst the Muslims. Then Amir al-Mumineen, peace be upon him, also says to Malik al-Ashtar, peace be upon him, to how to choose his soldiers and how to choose his military commanders. Because it's such a crucial position, as we saw in Iraq. The entrance of ISIS was given to them by the leaving of the post of military commanders and Muslim. It was a betrayal. It was a military commander who left his post with 50,000 soldiers from Mosul. And that's how basically they opened the doors to ISIS. So Amir al-Mumineen, peace be upon him, emphasizes on this. To choose your soldiers and commanders wisely. Not based on which family they come from or what's their background. Their background should only be based upon piety.  If they are not living by the laws and commandments of Allah SWT and the Prophet peace be upon him and the teachings of the Prophet peace be upon him and your Imam, which is Amir al-Mumineen, Ali ibn Abi Talib then this person should not be even considered to rule over the Muslims. If his interests aren't the interests of Islam and Allah SWT and the Prophet peace be upon him, this person should not even be chosen to rule or to be given such a post, such an important post. And also Amir al-Mumineen tells him and the purest when it comes to his pocket. Because a military commander can destroy a nation, can revolt against his commander can lead his people into destruction if this person is willing to be bribed. If he's willing to take a bribe, if he's willing to be seduced by this dunya and its dinars then this military commander is of no good to the Muslim society or any nation. Doesn't matter whether they are Muslim or non-Muslim. If a military commander is corrupt, then you see the destruction of a nation. So the posts and occupations when it came to the government of Amir al-Mumineen, Ali ibn Abi Talib was based upon whether they could uphold this post in a religious manner. Because Islam gave laws for every single aspect of life. And Amir al-Mumineen, alaihi wa sallam, and the Prophet of Islam gave the rulings and the teachings of how a ruler should be, how a military commander should be. So these were the criterias in the government of Ali ibn Abi Talib. And those were the laws and the words that we can compare to the sixth doctrine that compares to the Bill of Rights. Which was written in the 17th century, in the late 17th century. When we examine the letter of Ali ibn Abi Talib to Malik al-Ashar, we see that even in the time of Ali ibn Abi Talib when he ruled he gave the people the opportunity to even judge against him. There was one time when someone stole something or took something that belonged to Ali ibn Abi Talib and when Imam Ali asked him for it, he said, no, this is mine. And he took Imam Ali ibn Abi Talib to court. This is not just the government of Amir al-Mumineen, but this is the teachings of Rasulullah sallallahu alaihi wa alaihi. And Amir al-Mumineen walked the footsteps of Rasulullah sallallahu alaihi wa alaihi. And Rasulullah became ill. The last sermon he gave amongst the Muslims, at the end of the sermon he told the Muslims, if there is anyone who has something against me, come forward.  So I want to do the same thing to you, as this is the only way of justice if you claim to be just.  You harmed me, I get to harm you back. And at the time the Muslims became very angry. How does this man dare speak to the Prophet? The Prophet is ill, these are his last moments. And this man is wanting to seek revenge from the Prophet, let's say. Rasulullah sallallahu alaihi wa alaihi says, yes, where did I hit you?  So he says, the Prophet tells him, come forward. The man comes forward, Rasulullah gives him his cane and removes his shirt and reveals his stomach. This man ends up kissing the stomach of Rasulullah sallallahu alaihi wa alaihi and says, I ask refuge from Allah s.w.t by the stomach of Rasulullah from the fires of hell. Rasulullah sallallahu alaihi wa alaihi prays for this man. And this man ends up learning from Rasulullah what true mercy is, what true leadership is and takes the Shahada of the Shadu'a Allah, the God of Allah and the God of Muhammad and Rasulullah. I mean, when we hear of such teachings of Rasulullah and such narrations, we can't be surprised that Ali ibn Abi Talib peace be upon him would walk on the footsteps of his cousin Rasulullah. His mentor, Amir al-Mu'mineen opened his eyes and the eyes of Rasulullah sallallahu alaihi wa alaihi the first person he saw after his mother gave birth and the Ka'bah was Rasulullah sallallahu alaihi wa alaihi he was two days old and from two days old to the time of departure of Rasulullah Amir al-Mu'mineen would spend every single moment that he could with Rasulullah sallallahu alaihi wa alaihi even when he was a young boy, six years old who took him into his home was Rasulullah sallallahu alaihi wa alaihi he came to Abu Talib alaihi sallam because he was a poor man and they asked to raise one of the children of Abu Talib Rasulullah sallallahu alaihi wa alaihi took Amir al-Mu'mineen into his home Amir al-Mu'mineen lived in the home of Rasulullah sallallahu alaihi wa alaihi and Khadija alaihi sallam that's where he grew up Amir al-Mu'mineen has a saying I used to follow Rasulullah sallallahu alaihi wa alaihi like a baby camel that follows his mother every footstep that Rasulullah sallallahu alaihi wa alaihi used to take I used to step in that same footstep so and this was the reason why they truly fought Amir al-Mu'mineen and why Amir al-Mu'mineen was not given the privilege to his divinely chosen position of Khilafa and leadership after Rasulullah sallallahu alaihi wa alaihi because when he was asked how will you rule he said I would rule upon the teachings of Allah subhanahu wa ta'ala the commandments of Allah subhanahu wa ta'ala and his prophet and inshallah I will illustrate this segment to you later on into the show inshallah moving on to the seventh article which states no man can be accused, arrested or detained but in the case is determined by the law and according to the forms which it has been described those who dispatch carry out or cause to be carried out arbitrary orders must be punished but any citizen called or seized under the terms of the law must obey at once I mean we see this with the story that I just mentioned about the person who accused Ibn Talib of taking something with him he allowed himself I mean the ruler of the Muslim world to go to court to go to court and sit in court as you know a defendant or to be prosecuted when the judge asked Amir al-Mu'mineen he told him Ya'ab al-Hasan and when you want to respect someone you call him by his, you don't call him by his name you call him by his by his son's name so and he addressed the person accused Ibn Talib by his first name I mean we need not allow that he told the judge no when you address him either address him like me or address me like him like Ya'ali or Ya'ali Ibn Ibn Talib you know and at the end the judge told Ibn Talib do you have anything to prove that this is yours I mean the commander of faith for the ruler of the Muslim world is sitting in court and the Khalifa is sitting in court and asked for evidence and you know we don't see this with with the rest of the we don't want to say Caliphs or Khulafat or any ruler that ruled before or after upon man yeah definitely but Sayyidina I mean if you can mention a few things in quotes about this insha'Allah Amir al-Mu'mineen Alaiyaf al-Salatu was-salam says he says I don't take a person or prosecute a person based on someone's accusations you know every day especially you're a judge there will always be accusations upon people and most of the time they're found innocent how many times do we see in American courts where there were people who were imprisoned for 30 years and then after 30 years they were left or their sentence was over after 30 years they found out this person is innocent and they were given their freedom based on accusations and not just this is to illustrate you know because today we live in an era where you know American news British news Australian news Russian news is all over you know you could see it from your telephones you could see it from your laptops so we know what's going on around the world even though I think America has you know the best laws out of all the nations around the world definitely much better than the laws that are in Bahrain or Saudi Arabia or Qatar or these countries that are run by Muslims as of yesterday in the city of New York they actually accepted Muslim holidays as a national holiday the Eid of Fitr and Eid al-Adha and honestly this is democracy or it is some type of freedom and of course if there is an infallible he's not ruling there will be injustice but there is a big difference between you know a country like Bahrain which majority of its population are Shia Muslims and the rights have been neglected and taken away from them for the past several years and every day there is protests and people dying and arrested just because of their belief and these countries you know declare that they are Muslims but this is nothing of Islam far away from Islam there is a saying that you see Islam in the west practiced in the west by non-Muslims then you see it practiced by the Muslims in the Middle East I mean we see that even when we treat the animals you know here in Muslim worlds animals have no right he wanted to make wudu one day and a cat came and started drinking from the water he let the cat drink until it was full then he made wudu from that same water do we carry out that do Muslims carry out these traditions we say inshallah we hope that you know we can learn from them I don't imprison people I don't punish people based on accusations and I don't punish based on assumptions just because someone assumed that this person had committed adultery or drank and we see this amongst the Muslims they see a person coming out of a store that sells liquor and the next day throughout the whole community as an alcoholic maybe he needed to buy some hot cheetos or something he needed to buy bubble gum maybe he wanted to buy a bottle of water water but this actually happened one time a person walked into an alcohol store not knowing it was an alcohol store you know in America and Canada and the UK most stores sell liquor but they sell everything else as well he wanted to use the phone and someone from the community passed by the same street and saw him the next day this is an example you brought and this actually happened in the world that we live right now when we read this declaration we see that you can't accuse someone but propaganda and accusations play a huge role in the demolishment of nations of course phones are tapped your internet cookies are all watched over before you've even committed a crime there's people watching you the government is already watching you but in Amir al-Mu'minin's government you're not found guilty unless you commit a crime no one has the right to come and butt into your business or into your life unless you are found guilty then Amir al-Mu'minin has another word of course you know the seventh segment the eighth and the ninth they're very similar so if we could read that and then start explaining more in detail through the words of Amir al-Mu'minin the eighth article states that the law should establish only penalties that are strictly and evidently necessary and no one can be punished but under the law established before the offense similar to the ninth article which states any man being presumed innocent until he is declared he is declared guilty so found guilty this is very significant when we compare the two and compare it to the quote you just mentioned about someone has to you have to find him in the action for example robbery or murder or there has to be yesterday we mentioned that there has to be four witnesses to the crime and witnesses not any normal witnesses if you bring four criminals that want to say their witnesses Islam does not accept their their witness or bribed they have to be just people they are known not to lie they are known to be truthful or else the court cannot take them for witnesses the quote you just mentioned as well how many times do we see people get arrested for something they haven't done or just being accused for something and I am going to tell you that 1400 years ago and you see how eloquent his words are if you see the laws that you have read they are at least 3 sentences long Amir al-Mu'mineen describes it in one sentence 5 words which one is more powerful definitely which one holds more value Amir al-Mu'mineen says you can't punish someone before he has committed a crime he tells all his workers and and governers around his empire Amir al-Mu'mineen ruled over a very large amount of space of land you know what's equivalent to over 30 countries today and he had workers that worked for him and governing for him over these countries or states within the Muslim Ummah he writes to all of them he tells them you can't punish someone before he has committed a crime or he has found guilty and he has only found guilty if there are witnesses involved there are 4 witnesses involved very similar to the 7th and 8th and 9th doctrine they are very similar together of the French Bill of Rights another saying of his he says the person who you have no proof over you don't have proof that he was a thief or a murderer or a person who conducted a sin or a crime you don't have proof over him then you have to let him free you can't hold him sometimes we see today they still put you in a cell further notice sometimes you spend days in a jail cell until you get a lawyer until you are proven innocent in Imam Ali's government every single human is innocent until found guilty do you see the opposite do you see where the difference is in Amir al-Mu'mineen's government and in Islamic law every single human being is innocent until proven guilty there is an instance where a man comes to Amir al-Mu'mineen Amir al-Mu'mineen is saying this occasion that occurred with him he says a man came to me and this man told me that Allah ibn Wahab wa Zaid ibn Haseen these two individuals in Kufa they were saying threatening you I overheard them saying such things that if anyone had heard them he had beheaded them or had taken them custody and placed them into a life life in prison sentence so Amir al-Mu'mineen asks him so what do you suggest he says I suggest that you summon them and you take off their heads these people are threat to you he asks Amir al-Mu'mineen ask him have they done anything yet he says no but I overheard them saying so they are a threat Amir al-Mu'mineen turns to him and says that I have figured that you are a person of no religion no faith no faith and religion and no aql no brains either you want me to punish individuals in my government before they commit a sin yes they overheard them speaking they have the freedom to dislike me you know you cannot force everyone to love me Rasulallah could not force everyone to love him Jesus couldn't force everyone to love him neither 124,000 prophets there were people that stood against them against Moses against Jesus against Muhammad so Amir al-Mu'mineen tells him to punish them for them just carrying hatred towards me punishment will only occur when a crime occurs or when a crime occurs and Amir al-Mu'mineen was so strict so strict when it came to abiding by the laws and setting his laws it didn't matter who it was he was so precise one day there was a man who had committed a sin and Qambar was ordered to lash him let's say he was ordered to be lashed 90 lashes 60 lashes it depended on you know the ruling Qambar mistakenly lashed him 3 extra lashes Amir al-Mu'mineen was standing aside and he counts the lashes he tells Qambar Qambar you lashed him 3 extra lashes that's now of what was you know written by Allah subhanahu wa ta'ala or placed by Rasulullah sallallahu alayhi wa alayhi by islamic law so you didn't have the right to lash him these 3 extra lashes so now by islamic law and by the laws of the government of Ali ibn Abi Talib this person owes you 3 lashes should have counted correctly he gives the whip to the person who was lashed and he tells him you either forgive Qambar or you take your 3 lashes even a person who is so close to Amir al-Mu'mineen like Qambar peace be upon him he was in the house of Ali ibn Abi Talib he lived with him he was the closest servant to Amir al-Mu'mineen but justice is justice justice is justice and justice it goes for me in you it goes against us and it goes against Qambar as well all subjects are subjects in the government of Ali ibn Abi Talib all citizens are citizens in the government of Ali ibn Abi Talib and this is equality this is equality if Amir al-Mu'mineen had said no because Qambar is my servant and I love Qambar what is equality like other khulafa and rulers did in their era this is the difference between Ali ibn Abi Talib Ali ibn Abi Talib and everyone else this is the difference that even a person who is close to him it doesn't matter justice is justice Amir al-Mu'mineen is in the Masjid of Kufa his last days and everyone has heard the famous words of Amir al-Mu'mineen when he stood and addressed his citizens ask me before I am no longer with you and you lose me ask me anything that you wish anything from the throne of Allah and below I have the answers for from where I am sitting it said a very tall man stands up tall man you know with a big body have you seen the big show someone like the big show he stands up and he tells Amir al-Mu'mineen A.S. that he raises his voice towards Amir al-Mu'mineen and says oh the one who claims to know what he does not respond to my questions even a child to his father can he speak to him this way let alone the leader of the Muslims or if this man wasn't a Muslim because he was not he was one of the Jews that lived inside the government of Ali ibn Abi Talib but he is your ruler you should at least show him some respect those around Ali ibn Abi Talib rush towards him they pull out the swords Amir al-Mu'mineen says relax guys calm down this is not the way of the representatives of Allah subhanahu wa ta'ala the vice-gerent of Allah subhanahu wa ta'ala the proofs and miracles of Allah are not shown by punishment by punches and kicks no the miracles and the proof of Allah are shown through mercy and I show this man mercy let him ask his question so this man starts to question Amir al-Mu'mineen and Amir al-Mu'mineen responds to every single one of his questions but you see the different you see how Amir al-Mu'mineen ruled over his subjects how he ruled over his subjects didn't matter if he is a Muslim or a Jew they are equal when it comes to government when it comes to governance when it comes to governance it doesn't matter if they are Muslim or Jew as long as he is not breaking the laws of government then he should be respected he should be respected so this is what I can think of when it comes to the 7th and 8th document or doctrine so if you could please recite the 9th one we I mentioned the 9th one did you already mention the 9th one? yes the law sorry any man being presumed innocent until he is proven guilty this law I mean we just mentioned that with Ali bin Bitalib but going back to the story of Ali bin Bitalib being in court with that person he was asked Ali bin Bitalib was asked do you have any proof that this is yours and the man swore by Allah SWT that that's his Ali bin Bitalib says if he has sworn that's his then I am no longer I have no longer anything to say and Ali bin Bitalib left I mean the commander of Faithful at the end he was not proven guilty but the person lied in court and Ali bin Bitalib accepted that because he didn't have any witnesses because he didn't have any witnesses when the man saw that of Ali bin Bitalib he rushed to him and you know the justice of Ali bin Bitalib I mean he even put the law on himself and if the law is against him he's going to take it because as I said he lived the life of the Rasul Allah SAW he lived by the commandment of Allah SWT Amir al-Mu'mineen alaihi wa s-salatu wa s-salam when he was asked to take Khilafah his words were wa raddu al-haqqa ila ahlih wa taba'u sunnatinabiyyiko if you want true leadership bring it back to me and follow the sunnah the tradition of Rasul Allah SAW and for them this had no value this had no value this is why historians say when Amir al-Mu'mineen SAW said this they explain the atmosphere within the gathering they say they started winking to one another and whispering to one another after Amir al-Mu'mineen SAW gave his sermon after the death of Umar when the candidates were Othman and Ali why did the Khilafah go to Othman because Amir al-Mu'mineen declined their proposal and he gave them his proposal he said you either follow the tradition of Rasul Allah and the commandment of Allah SAW or else I don't want to lead you so he says they started winking to one another and started whispering to one another saying we know that his value and that he he is the person who deserves the Khilafah and the leadership of Rasul Allah SAW but he is a man who doesn't favor one another but he is a man that does not give opportunity to a man over another he doesn't favor Ahmed over Sayyid Muzaffar or Sayyid Muzaffar over Ahmed because he is related to him you see and so if you did place him as a Khalifa he would count you the Bani Umayyah and you the muhajireen and you the Ansar with the rest of the Muslims as equals he wouldn't give the positions to the muhajireen those who migrated with Rasulullah from Mecca to Medina because they were the first to believe or the Ansar because they paid allegiance to Rasulullah SAW or based upon family members whether they were from Bani Hashem or not no, all Muslims are are equal by giving it to because he will give it to those who you wish to rule over you for those who you wish to govern and have power and this is why they took the Khilafi from Ameer Al-Mu'mineen SAW Ameer Al-Mu'mineen SAW lived by the Quran when the Quran states in the holy verse that Allah SWT created you as tribes and nations for you to get to know one another and the best of you and the greatest of you is those who have the most piety and this was the tradition in the life of Ameer Al-Mu'mineen because Rasulullah SAW said and Arab is not greater than an Arab unless he's more pious he's more religious than him or else there's no reason Allah SWT created us the same way we come from the same father doesn't matter what he believes in it's all based on piety it's all based on how much Allah SWT on the other hand how did the other rulers the other so called Khilafah rule over the Muslims Sayyidina if you can excuse me we're coming to the conclusion how many minutes do we have? we have two I believe two minutes can we share one story and then come to an end? at the time of Ibn Masood one of the Sahaba of Rasulullah very close companion Rasulullah SAW wrote a letter to to Uthman actually he wrote a letter to Al-Mugayrah that I mentioned the other day and basically he was saying that we the Muslims and the companions of Rasulullah we don't accept this way of governance so Al-Mugayrah writes to Uthman that Ibn Masood is spreading this propaganda against you days pass Ibn Masood goes to the masjid where Uthman is giving a sermon as soon as Uthman sees Ibn Masood he orders his guards to grab Ibn Masood and to take him out of the masjid Uthman comes down from the pulpit he leaves his sermon he orders his guards to severely beat him Uthman also starts to kick Ibn Masood in his stomach in his chest to near death a companion of Rasulullah does every muslim not know Ibn Masood Ibn Masood is beaten to near death why? because he just did not agree with the way Uthman was ruling and his people were ruling historians say that Uthman punished him for speaking out and for burial of Abudar Abudar was killed for the love of Ali Ibn Abi Talib and Ibn Masood buried Abudar he was whipped and lashed 40 times by Uthman for burying another Sahaba of Rasulullah sallallahu alayhi wa alih is this a crime? I ask you by Allah is this a crime? and this is not a normal man he is the very close companion of Rasulullah sallallahu alayhi wa alih both of them one Ibn Masood and one Abudar for us in Islamic law even if a non muslim dies we should bury him let alone the closest of companions Rasulullah sallallahu alayhi wa alih this is a reason why they should be punished why muslims should be punished they should be beaten to near death and persecuted and lashed Subhanallah this is the difference between Amir al-Mu'mineen and other Khulafa I wish we had couple more minutes so I could share another story but if we are coming to a conclusion then definitely and the difference between the justice of Amir al-Mu'mineen and the other caliphs Amir al-Mu'mineen did not see a difference between your color this is not my opinion for me to be born brown Allah created me brown it's not my choice to be born black Allah chose me to be born black or for those who are black to be born black for you to be born other than Arab but the time of Omar those who were not Arab they were persecuted in everything they didn't get the equal share if you were a non-Arab you weren't allowed to marry an Arab you weren't allowed to marry an Arab you were not allowed to inherit you were not allowed to inherit why aren't all Muslims given the privilege to inherit from their fathers as Muslims one day he walks into the bazaar and he sees all entrepreneurs that held the bazaar of the Muslims majority were non-Arabs he bans them he bans them and he says non-Arabs are not allowed to sell buy and sell in our government unless they gain more knowledge in our religion why were these criteria placed upon the Arabs so they were placed upon the non-Arabs they were ignorant before so lucky so what was this injustice what was this what was the equality between man when Rasulullah says and those who did not go by the laws of Umar they were severely punished if a non-Arab married an Arab he was punished if they did inherit they were punished if they went to open a store to buy and sell they were punished why so called justice according to them and inshallah our viewers will hear from us and go read books of history inshallah to see whether we are saying the truth or not definitely whether the truth is where you think or where it's not you know he says justice is with Ali and Ali is with justice I mean similar to the Rasulullah sallallahu alaihi wa sallam he says Ali with Quran with Ali the Quran is with Ali and Ali is with the Quran when we hear this wise words we can only ponder whatever Ali Nabi Talib said was not out of was not out of his desires or wishes it's based on the Quran and inshallah we can continue our discussion tomorrow inshallah our viewers early inshallah inshallah we pray for them by the shrine of Sayyid al-Shahada the master of the martyrs may Allah bless them and their families and we ask all of you to keep us in your doze and your prayers may Allah bless you all thank you very much Sayyidna inshallah no it's too early okay I get to shake your hand a little bit but thank you very much Sayyidna and thank you very much respected viewers inshallah as Sayyid mentioned we will not forget you in our prayers when we visit the holy shrine on a night like this than the last night of Thursday in the Ramadan it's a very significant night to do dua inshallah we can learn from the teachings of Ahlul Bayt and especially Ali Nabi Talib peace be upon him so stay tuned for the next episode wa salamu alaikum wa rahmatullahi wa barakatuh I'll see you again once again