 Hello fellow developers and hey big shout out to our future AI overlords. Let's talk about chat GPT. I'm going to assume that if you clicked on this video you probably have already played with chat GPT at least a little bit. The GPT part of chat GPT is short for Generative Pre-Train Transformer but basically what it is is it's a large language model that is good at simulating human-like conversations by predicting what word will come next based on the words that came before it. It's something that we humans can do. We're pretty good at it. Consider this motto of Java and most cross-platform programming languages. Write once, run blank. You could probably fill in the blank. It's probably run anywhere and not runaway screaming, right? So that's basically the principle behind chat GPT. Chat GPT has been trained on a corpus of text from all over the internet but up to and only including the year 2021. So anything that happened after 2021 it's not going to know about. The interesting thing about chat GPT is that it can answer not only just straightforward questions but make at least little logical leaps. If you look at my screen right here I've got two questions I've asked chat GPT just as an example to demonstrate this. The first one's fairly straightforward. What is a tuxedo? And there are a bunch of webpages and other textual information available online that define what a tuxedo is. But the second question I've asked is what is the likelihood that someone waiting for a bus in a bus depot is wearing a tuxedo? This is a question that would stump classical conversational AI. In fact it's an example that my AI prof back when I was in university brought up and said this is something that AIs cannot answer but chat GPT can. It actually says hey it's unlikely somebody in a bus depot is going to be wearing a tuxedo because tuxedos are formal events and a bus depot are most definitely not formal places. So chat GPT can produce some really good answers to questions. Now on Stack Overflow they have at least a temporary ban on chat GPT generated answers. One reason of course is that people are trying to get maximum stack overflow points by feeding programming questions into chat GPT. Yeah that's cheating. The other bigger problem with chat GPT answers is that they are often wrong when it comes to programming. So here's the challenge. I'm going to ask chat GPT a few questions that pertain to Auth0 and Authentication and Auth, and let's see what happens. All right let's take a look at a couple of questions. I've already asked chat GPT. It's kind of fascinating watching the answers appear word by word but for the sake of brevity I pre-entered these questions and I'm going to show you the answers. So the first one is should I implement my own Authentication or use Auth0? And chat GPT in its own chat GPT way went with a bland fairly unopinionated answer. It went with the consultant's answer in fact it depends. Basically it says look if your application is simple uses a small user base yeah row your own but if your app is larger and has a larger user interface use Auth0. I'm going to disagree with this just a little bit in that even if your application is small and uses a small user base the one good reason to use Auth0 to implement your Authentication is simply that you know what it's one less thing you have to do. You can with Auth0 just implement login that way and that way you can spend more time focusing on what your application actually does. Okay let's go with another question. This one's a little simpler this is a simple matter of fact question in fact it is what is Oauth? And chat GPT's answer is pretty much correct but that shouldn't be too surprising because there are a bunch of web pages and other online information out there that got fed into the model that actually just simply describe what Oauth is that's nice and easy but I decided to be a little smart alecky and just say okay brainiac that's a little too technical for me. Could you make it a little simpler and chat GPT obliged actually the description is pretty nice and it's a little more lay person friendly and it uses some nice examples and yeah I would approve of this answer. Well that's the authorization question out of the way what about authentication so I asked what is OIDC and chat GPT replies OIDC or open ID connect builds on top of Oauth that is correct it's a simple identity layer on top of the Oauth 2.0 protocol correct widely used in modern web applications to enable single sign-on nice once again this is technical so I said make it simpler I fell off my bike this morning and hurt my head and chat GPT gladly obliged once again a good summary of what OIDC is and in a very lay person friendly way so once again yeah well done chat GPT okay so I decided to get a little more specific and one of the questions I asked chat GPT afterwards was what's an ID token now this is an interesting thing remember the previous question I asked it what OIDC was and now I'm asking about an ID token chat GPT takes previous bits of your conversation into into consideration when providing an answer and in fact I'm pretty impressed by this answer because the first thing it does say when answering what an ID token is is in the context of OIDC the thing I just mentioned and it says an ID token is a JSON web token it's a string composed of three parts the header the payload the signature typically used in conjunction with Oauth 2 yeah not bad once again I asked I asked it make it simpler remember I hurt my head this morning and it provided a simpler answer quite nice I did the same thing with access token and by the way feel free to try this you know on your own go fire up chat GPT and ask it Oauth and OIDC questions and see what kind of answers you get the answer I got also looks correct an access token is a string that represents the authorization granted to a client application yada yada yada very nice and it makes mention of refresh token so I then ask what's a refresh token and it provided me with an answer and not only that I also asked immediately after that because it mentioned that three fresh tokens can have indefinite lifespans are their security downsides to using refresh tokens this is interesting because not only to provide a good answer it also responded really well to colloquial English I mean downside normally when people write about this sort of thing they typically use the word risk so chat GPT is pretty good at understanding colloquial language which is pretty nice so so far it's been right about tokens these are answers to straightforward questions so I shouldn't be too surprised I am very impressed by the way it does provide its answers all the questions I've asked so far are fairly beginner level stuff that's fine so let's give chat GPT a little bit more of a challenge so the next question I ask was how do you write an iOS app that uses ozzio for login clearly remember I mentioned I hurt my head apparently I'm writing as if I hurt my head but chat GPT's answer is mostly correct everything looks like it makes sense point number two here install the ozzio iOS SDK in your app using cocoa pods or carthage I prefer using the Swift package manager built into Xcode it's a lot simpler but you know those two are correct as well where I take exception is here actually with step five when the user initiates login process present the login screen and it says you do this by using a method called auth zero dot authentication and I'm gonna call up Xcode right now and that's actually not the case at least not for not for the app that I present in all my articles on Swift development it's actually auth zero dot web auth so we'll hold that for now and what I'm gonna do is I'm gonna switch back to chat GPT and talk about the next answer here which is how do how do write what what's how do I write an android app that uses auth zero for login and once again it's going hey you know the method you should be using is auth zero dot login I'm gonna call up Android studio and if you take a peek here that is not the case in fact the object isn't even auth zero it's web auth provider the method is called login but different creature entirely so in two cases in both the iOS case in the android case chat GPT was wrong so I challenged it and I said I think the method should actually be web auth provider dot login and chat GPT actually said you are correct and I'm going well why didn't you do that the first time now what it did do in order to make up for its boo boo is it provided me with some code and generally this looks correct once again it is now using the web auth provider dot login method it's using the method chaining that we expect and of course one of the it uses the object with some methods to handle both success and failure cases for login so that looks correct and then I said look that looks like Java and I'm an android developer and I prefer using the preferred programming language for Android which is Kotlin could you show it to me in Kotlin and it gave me this but this time instead of providing the start method with an object with call back call back methods to handle the success and failure case it uses the it uses Kotlin's when structure instead and this doesn't work under the current android SDK so it's pretty it looks right but it actually doesn't work so in response I told chat GPT the Kotlin implementation you provided doesn't work and it apologized very nice it's nice when computers have manners and it provided me this quote quote correct version of the code which is basically the same thing with slightly different nesting once again the correct answer is more like this the start method needs to be provided with an object that implements an on failure and on success method that works this stuff here doesn't so what's the point of all this well the practical upshot is you know what if you want to know what the current state of AI looks like play around with chat GPT it's probably also a pretty good tool for writers if you're experiencing writer's block or you know you're just facing that terrible moment when you've got a blank screen in front of you an empty document and you need to get started it's good for generating writing prompts for answering questions I would always say you know take its answers with a grain of salt be a little bit skeptical and for programming don't quite listen to it just yet it's not quite there eventually programming tools will probably have a better version of a chat GPT like thing that will help you with you know the the more drudgery part of programming but right now it's still better to actually pay attention to other programmers and you know what if you want to learn how to write aught zero apps don't listen to chat GPT come to the aught zero blog aughtzero.com slash blog slash developers and read our articles we're gonna be right chat GPT isn't sorry future robot overlords you're not quite there yet thanks very much and yes from all of us at aughtzero all of us humans at aughtzero a happy coding