print('Why OAuth')
print('OAuth roles')
print('\tResource Server(where assets (through API) exists) (ex:accounts, statements, transfer)')
print('\tResource Owner(User)')
print('\tClient (app used by the user)')
print('\tAuthorization Server (which can issue access token)')

print('---------------------------------')
print('Grant type(Nothing but how the client gets access token)')
print('Decided by Whether Resource owner involed or not and what type client is involved')

print("\tClient Credential Grant type")
print("\t-----------------------------")
print('\t\tHighly Trusted Client Environment')
print('\t\tMachine to Machine Communication')
print('\t\tResource Onwer not involved')
print('\t\t\tExamples')
print('\t\t\t\tServer Side Applications')
print('\t\t\t\tInternal Cron Jobs')
print('\t\t\t\tInternal Applications')

print("\tAuthorization Code Grant Type")
print("\t-----------------------------")
print("\t\t3rd party appilcations")
print("\t\tMobile/Web applications with server side code")
print("\t\tResource ownser(end user)consent required")
print("\t\tHighly secure. Client never sees user name and passwords")
print('\t\t\tExamples')
print('\t\t\t\tAny application where you have seen SignIn with Google/FaceBoo/Twiser Provided consent')

print("\tResource Owner Password Credenetial")
print("\t-----------------------------")
print("\t\tFirst party applications")
print("\t\tClient fully trusted with user credentials")
print('\t\t\tExamples')
print('\t\t\t\tApp builts by same company.')

print("\tResource Owner Password Credenetial")
print("\t-----------------------------")
print("\t\tFirst party applications")
print("\t\tClient fully trusted with user credentials")
print('\t\t\tExamples')
print('\t\t\t\tApp builts by same company.')


print("\tImplicit Grant Type")
print("\t-----------------------------")
print("\t\tSimplied version of Authorization code")
print("\t\t3rd party single page applications")
print("\t\tNative Apps")
print('\t\t\tExamples')
print('\t\t\t\tSingle page UI Only applications.')

