This commit is contained in:
@@ -12,17 +12,16 @@ using System.Text;
|
|||||||
|
|
||||||
namespace Auth.Controllers {
|
namespace Auth.Controllers {
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v1/mauth/")]
|
[Route("api/auth/")]
|
||||||
public class MAuthController : MistoxControllerBase {
|
public class MAuthController : MistoxControllerBase {
|
||||||
|
|
||||||
public MAuthController(DatabaseService db) : base(db) { }
|
public MAuthController(DatabaseService db) : base(db) { }
|
||||||
|
|
||||||
// Sends the public key to clients so they can verify sessions.
|
// Sends the public key to clients so they can verify sessions. - Verified working
|
||||||
[HttpGet("publickey")]
|
[HttpGet("publickey")]
|
||||||
public IActionResult PublicKey() {
|
public IActionResult PublicKey() {
|
||||||
try {
|
try {
|
||||||
RSA rsa = AuthJWT.RsaPublicKey.Rsa;
|
RSA rsa = AuthJWT.RsaPublicKey.Rsa;
|
||||||
rsa.ImportParameters(AuthJWT.RsaPublicKey.Parameters);
|
|
||||||
byte[] publicKey = rsa.ExportSubjectPublicKeyInfo();
|
byte[] publicKey = rsa.ExportSubjectPublicKeyInfo();
|
||||||
string base64 = Convert.ToBase64String(publicKey);
|
string base64 = Convert.ToBase64String(publicKey);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|||||||
Reference in New Issue
Block a user